Skip to content

Generate

Standard · 1 credit

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

FieldTypeRequiredDefaultDescription
typestringYes—password, token, or nanoid
lengthintegerNo16Output length (max 4096)
options.uppercasebooleanNo—Include uppercase letters (password only)
options.lowercasebooleanNo—Include lowercase letters (password only)
options.numbersbooleanNo—Include digits (password only)
options.symbolsbooleanNo—Include special characters (password only)
options.exclude_ambiguousbooleanNo—Exclude 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
}