Add to Chrome

Password Generator API

A free JSON API for strong passwords, passphrases and PINs. No sign-up, no API key, CORS enabled.

Quick start

Send a GET request to https://api.suggestpassword.com/. With no parameters you get one 20-character password:

curl "https://api.suggestpassword.com/?length=20"
{
  "generated_password": "x7Kq#bT2mW!pZr9&LdYe",
  "passwords": ["x7Kq#bT2mW!pZr9&LdYe"],
  "type": "password",
  "entropy_bits": 119.7
}

generated_password is always the first result; passwords holds all of them when you ask for more than one.

Try it

Press "Send request" to call the live API.

Parameters

ParameterValuesDefault
typepassword, passphrase or pinpassword
lengthPassword: 4–128 characters. PIN: 4–12 digits20 / 6
countNumber of results, 1–501
upper, lower, digitstrue or false (password only)true
symbolsnone, basic (!#&) or all (!#&-=~@$%^*_+.?|)basic
no_ambiguoustrue leaves out 0 O o 1 l I |false
wordsPassphrase words, 3–125
separator-, space, ., _ or none-
capitalize, numbertrue or false (passphrase only)true

Every character type you enable is guaranteed to appear at least once. The older advanced=true parameter still works and means symbols=all.

Examples

Ten 32-character passwords with every symbol:

curl "https://api.suggestpassword.com/?length=32&symbols=all&count=10"

A six-word passphrase separated by spaces:

curl "https://api.suggestpassword.com/?type=passphrase&words=6&separator=space"

JavaScript:

const res = await fetch('https://api.suggestpassword.com/?length=24&no_ambiguous=true');
const { generated_password } = await res.json();

Python:

import requests
pin = requests.get('https://api.suggestpassword.com/', params={'type': 'pin', 'length': 6}).json()['generated_password']

OpenAPI, AI assistants and agents

The API is described in an OpenAPI 3.1 specification, so you can import it into Postman, Insomnia or a code generator, or hand it to an AI agent as a tool definition. For language models and AI search there's also a plain-text summary at /llms.txt.

Building an agent? Give it the OpenAPI URL and it can generate passwords for your users on request. Do remind it that a password generated by a service passes through that service; generating locally is safer for real accounts.

Errors and limits

Invalid input returns HTTP 400 with a message, for example {"error": "length must be a whole number between 4 and 128"}. Too many requests return HTTP 429; slow down and retry. Responses are never cached.

FAQ

Frequently asked questions

Can't find what you're looking for? Send us a message.

Is the API free?

Yes, free for personal and commercial use. Please keep it to reasonable volumes: requests are rate-limited per IP address.

How random are the passwords?

They are generated with PHP's random_int(), which uses the operating system's cryptographically secure random source, with no modulo bias.

Do you log generated passwords?

No. Passwords are created per request and returned straight away. They are never stored or logged.

Should I call an API to make passwords for my users?

If your app can generate them locally, that is safer still: any password that crosses a network has to be trusted to that connection. The API is handy for scripts, prototypes, no-code tools and places without a secure random source.