About the API Key Generator
Modern API keys pair a short prefix that identifies the key type with a long random body, for example sk_live_.... The prefix helps you tell a secret key from a publishable one at a glance and lets secret scanners spot leaked keys. This tool builds keys in that style: set your prefix and length, and it generates the random part with the browser's secure random source.
These are well-formed random keys suitable for your own services and test fixtures. If you use a specific provider, follow their key format and generation; a real production key should be issued by your key-management system. Everything here runs locally, so the keys are private.
For a plain random secret, the Random Hex and Random String generators are simpler.
How to use
- Set the prefix and body length.
- Choose how many to generate.
- Copy the keys into your service or test data.
Common questions
- Why use a prefix?
- It identifies the key type and helps automated scanners detect leaked secrets in code.
- Are these real keys for a provider?
- No. They are well-formed random keys for your own services or tests. Providers issue their own.
- Is the random part secure?
- Yes. The body is filled from crypto.getRandomValues, the same source a server-side key issuer would use.