AI · Secret guide

Leaked ElevenLabs API Key: what to do in the first hour

High severityChecked liveLast verified · 5 min read

An ElevenLabs API key lets whoever holds it call the voice API as you: generating speech, cloning or using voices, and reading account information, with everything counted against your subscription’s character quota. On a paid plan, going over the quota can bill overage, and on any plan a stranger can burn through the characters you need. The key does not reach your servers. Replace it first, then check what it was used for.

Check your GitHub account for leaked secrets — free

Provider
ElevenLabs
Severity
High
Impact
SaaS account access and billing
Checked live by LeakWatch
Yes

What an ElevenLabs API key looks like

An ElevenLabs key starts with sk_ (an underscore, not a dash) followed by 48 lowercase hexadecimal characters:

sk_…XXXX   ElevenLabs API key (masked, 48 lowercase hex characters after the prefix)

The prefix is short and shared in spirit with other vendors, so the shape matters. Keys from OpenAI, Anthropic, OpenRouter and others use sk- with a dash. A string with capital letters in the body, or with fewer or more than 48 characters after sk_, is not an ElevenLabs key. The variable usually holding one is ELEVENLABS_API_KEY, and it is sent in an xi-api-key request header, which is a good thing to search for in code and logs.

How ElevenLabs API keys get leaked

  • Hardcoded in a script. A quick text-to-speech test with the key typed into the client call and committed.
  • Environment files. ELEVENLABS_API_KEY in a .env or compose file that lands in a repository.
  • Voice-agent and bot projects. Telephony, game and assistant projects that wire speech into other services keep several keys in one config, and the whole file gets shared.
  • Browser and mobile code. A key placed in a front-end bundle or an app so it can stream audio directly, where anyone can extract it.
  • Logs and screenshots. The xi-api-key header printed by a debug option, or visible in a screenshot of a request.

What to do in the first hour

  1. Open the API keys section of your ElevenLabs account (see the link below) and find the exposed key. Match it by name and by its last characters.
  2. Create a new key and, if your plan lets you, restrict it to the permissions the service actually needs, for example text-to-speech only. A restricted key limits the damage of the next leak.
  3. Set a usage limit on the new key if the option is available, so a stolen key cannot consume the whole monthly quota.
  4. Deploy the new key to the application or secret store, and run one short generation to confirm it works.
  5. Delete the exposed key from the same list, then retry a request with the old value to confirm it is rejected.
  6. Check usage. Look at the character count and the usage history since the exposure. Spikes, long generations you did not request, or activity at unusual hours are the signs to look for. Also check the voices on the account for ones you did not add.
  7. Look for neighbours. A voice project rarely holds only one secret. Rotate any model, telephony or storage keys in the same file, then clean the code. See I accidentally pushed an API key to GitHub.

Not sure what else leaked from the same repository? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at ElevenLabs

ElevenLabs keys are managed from the API keys section of your ElevenLabs account, after you sign in with the account that owns them. Select the exposed key and delete it. If you cannot find it, check whether it was created in another workspace or account. A person has not confirmed the exact menu wording for this guide, and the interface can change, so if what you see differs, look for the page where keys are created and listed, and follow ElevenLabs’ documentation.

How LeakWatch detects it

The rule is called ElevenLabs API Key. It recognizes sk_ followed by exactly 48 lowercase hexadecimal characters, with word boundaries on both sides, and it does not need a variable name next to it. Uppercase hex, a dash instead of the underscore, or a different length is not reported. The severity is high.

LeakWatch can check whether a detected key is still active with a read-only request to ElevenLabs. It never reads your data or spends your credits.

This type is checked live. LeakWatch sends one read-only request to the account-information endpoint of the ElevenLabs API, with the key in the xi-api-key header. That endpoint does not use any character quota, so the check never bills the owner. A successful answer means the key is live, and LeakWatch keeps only the plan tier and the character usage figures, never the key echoed back. Some keys are restricted to certain features: if ElevenLabs answers that the key lacks the permission for this endpoint, the key has still authenticated, and it is counted as live. Only a rejection of the key itself counts as invalid.

FAQ

Can someone use my cloned voices with a leaked key?

Depending on the key’s permissions, a holder can generate speech with voices available to your account. Review the voices on the account and the usage history, and delete the key before anything else.

My key was restricted to text-to-speech. Is it still a problem?

Yes, though a smaller one. A restricted key can still generate speech and consume your quota, so delete it and issue a new one with the same restrictions.

Is a key in a private repository safe?

Not necessarily. Collaborators, forks and CI logs can read it. Replace the key if the repository was ever public, or if you are unsure who has access.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with ElevenLabs.