Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Random Token Generator API

Cryptographically random tokens for API keys, session secrets and webhooks, as hex, Base64, Base64url or Base62, with an optional prefix such as sk_live_.

POST /api/v1/tools/random-token-generatorMCP random_token_generatorSecurity & PrivacyRandom output

Generate secure random tokens, API keys and secrets in hex, Base64, Base64URL or Base62, with an optional prefix. Up to 100 at once, made in your browser.

Input

Send these as a JSON object. Unknown fields are rejected.

bytes
Bytes of randomness per token (8 to 256); 32 bytes = 256 bits. (integer, 8 to 256, default 32)
encoding
Output alphabet. (string, one of hex, base64, base64url, base62, default "hex")
prefix
Text put before every token, e.g. sk_live_ (no spaces). (string, up to 64 characters, default "")
count
How many tokens (1 to 100). (integer, 1 to 100, default 1)
curl https://pithlab.com/api/v1/tools/random-token-generator \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"bytes":24,"encoding":"base62","prefix":"pk_test_","count":2}'