Skip to content

Generate

Standard · 1 credit

Generate cryptographically secure passwords, random tokens, or nanoids with configurable length and character sets.

FieldTypeRequiredDefaultDescription
typestringYespassword, token, or nanoid
lengthintegerNo16Output length (max 4096)
options.uppercasebooleanNoInclude uppercase letters (password only)
options.lowercasebooleanNoInclude lowercase letters (password only)
options.numbersbooleanNoInclude digits (password only)
options.symbolsbooleanNoInclude special characters (password only)
options.exclude_ambiguousbooleanNoExclude ambiguous characters like 0O1lI (password only)
FieldTypeDescription
valuestringGenerated value
typestringType that was generated
lengthintegerActual length
entropynumberBits of entropy
Terminal window
curl -X POST https://morso.dev/api/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type": "password", "length": 24, "options": {"uppercase": true, "lowercase": true, "numbers": true, "symbols": true}}'
{
"value": "k9#Lm$xR4!nQ7@pWz&vB3*jY",
"type": "password",
"length": 24,
"entropy": 157.2
}
Terminal window
curl -X POST https://morso.dev/api/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type": "token", "length": 32}'
{
"value": "a3f8c1d9e7b2046f5a9c3e8d1b7f0264",
"type": "token",
"length": 32,
"entropy": 128.0
}
Terminal window
curl -X POST https://morso.dev/api/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type": "nanoid", "length": 21}'
{
"value": "V1StGXR8_Z5jdHi6B-myT",
"type": "nanoid",
"length": 21,
"entropy": 126.0
}