API Key Generator

Generate API keys with a recognisable prefix and a secure random body, like the keys from Stripe or OpenAI.

API keysGenerated
  1. sk_LdeQnmATgJgFcQ6qtpEge1ZxEWB7fSHAZLEK7qzO
  2. sk_t8HA7BHAE0ST7hDLH1VUzna4q2oPLnpnCBS93NV3
  3. sk_hhVKPFj3oWUbKL7LZBfmPy7QkbTI5SWWjGSnF2wv
Runs locally in your browser

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

  1. Set the prefix and body length.
  2. Choose how many to generate.
  3. 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.