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

Source: https://botpassword.com/keys/elevenlabs
Last checked: 2026-10-25

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.

## Key types

| Type | Prefix | Secret | Scope | Expiry |
|---|---|---|---|---|
| User API key | — | Yes | Your account, optionally limited by endpoint scope, credit quota and IP allowlist | Optional Expire After from 15 minutes to 30 days, or Never |
| Service account key | — | Yes | A 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.

## 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 the 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.

## Gotchas

- 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 this key with AI agents (BotPassword)

- `run_with`: Runs 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_request`: Makes 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.
- `rotate`: Partly 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_secret`: Saves a value the agent already holds as a new vault item.
- `capture_secret`: Planned, not built yet: will read a newly created key straight from the page or command output into the vault.

## FAQ

### 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.

## Sources

- https://elevenlabs.io/docs/api-reference/authentication
- https://elevenlabs.io/docs/overview/administration/workspaces/api-keys
