AI and model APIs

ElevenLabs API keys: find, store, rotate, and use them safely with AI agents

ElevenLabs API keys are created at elevenlabs.io/app/settings/api-keys (personal keys need a Full Seat) or on the Service Accounts tab of Workspace settings. Send the key in the xi-api-key HTTP header. Keys can be restricted by endpoint scope, credit quota and IP allowlist.

ElevenLabs key types

TypePrefixSecret?ScopeExpiry
User API key
Expiry is available for user keys only. Creating personal keys requires a Full Seat.
—YesYour account, optionally limited by endpoint scope, credit quota and IP allowlistOptional Expire After from 15 minutes to 30 days, or Never
Service account key
Created from Workspace settings → Service Accounts, or via the API.
—YesA workspace service account—

How to create a ElevenLabs key

  1. Sign in to ElevenLabs and open elevenlabs.io/app/settings/api-keys.
  2. Create a key; optionally set scope, credit quota, IP allowlist and Expire After.
  3. Copy the key. For a service account key, use Workspace settings → Service Accounts instead.

Open ElevenLabs's key settings

Limiting what the key can do

Restrict a key by endpoint scope, custom credit quota and an IP allowlist of 1 to 100 public IPv4, IPv6 or CIDR entries. Requests from other IPs get a 403.

How to rotate a ElevenLabs key

  1. Create a new key.
  2. Switch your applications over to it.
  3. Delete the old key.

How to revoke a ElevenLabs key

  1. Delete user keys from the personal API keys settings page.
  2. Delete service account keys from the Service Accounts tab, or with the delete endpoint.

If your ElevenLabs key leaked

  1. Rotate the key: create a new one, switch apps, delete the old one.
  2. Keys exposed in public GitHub repositories are disabled automatically; rotate to restore access.

Things that catch people out

  • Requests from IPs not on a key's allowlist are rejected with a 403.
  • For client-side use, ElevenLabs points to single use tokens rather than exposing the API key.
  • Keys exposed in public GitHub repos are disabled automatically.

Using your ElevenLabs key with AI agents

A coding agent that can read your .env file or your shell history can read the key, and anything in its context can end up in logs, transcripts or a prompt-injected request. The safer pattern is to keep the key in a credential broker that performs the authenticated step for the agent and hands back only the result.

BotPassword works this way. For a ElevenLabs key, these intents fit:

IntentWhat BotPassword does
run_withRuns a command with the key injected as an environment variable or a 0600 temporary file, never on the command line, and redacts the key from the output.
http_requestMakes an authenticated API call after checking the destination against the hosts this key may be sent to. The response comes back with credential-shaped values redacted, and one that holds the key itself is refused.
rotatePartly built: creates a new key, stores it as pending, verifies it, promotes it, then revokes the old key after a grace period. Today it works for Cloudflare tokens and AWS IAM keys you have set up, and an agent can start it only under a grant with autopilot; other providers cannot be rotated through their API yet.
store_secretSaves a value the agent already holds as a new vault item.
capture_secretPlanned, not built yet: will read a newly created key straight from the page or command output into the vault.

Set it up in your agent: Aider · Amp · Claude Code · Claude Desktop · Cline · OpenAI Codex CLI · all agents

Frequently asked questions

Where do I find my ElevenLabs API key?

Create one at elevenlabs.io/app/settings/api-keys; personal keys need a Full Seat.

What header does ElevenLabs use?

xi-api-key.

Can I restrict an ElevenLabs API key?

Yes, by endpoint scope, credit quota and IP allowlist.

Can an AI agent use my ElevenLabs key without seeing it?

Yes, if the key never enters the agent's context. Instead of pasting the key into a chat or leaving it in a .env file the agent can read, keep it in a credential broker that injects it into the command or request on the agent's behalf. BotPassword does this with run_with, http_request, store_secret, so the agent gets the result and never the value.

Stop pasting ElevenLabs keys into agents

BotPassword is in early access. Request an invite and we'll email you when your spot opens.