API Key Generator
Generate production-ready API keys with prefixes, separators, and various formats used by Stripe, GitHub, and major APIs.
About API Key Generator
API keys are authentication credentials used to identify and authorize clients making requests to an API. Well-designed API key formats include a prefix that identifies the key type (sk_ for secret key, pk_ for public key, ghp_ for GitHub personal access tokens), an optional environment indicator (live vs test), and a random component generated from a cryptographically secure source.
Prefixed API keys are easier to identify in logs, rotate when compromised, scan for in code repositories (GitHub can automatically detect and alert on accidentally committed secret keys), and scope to specific environments. Stripe's key format (sk_live_xxx and sk_test_xxx) is considered an industry best practice for this reason.