For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Connect
BlogHelp CenterAPI PricingSign up
OverviewElevenCreativeElevenAgentsElevenAPIReception AIAPI referenceChangelog
OverviewElevenCreativeElevenAgentsElevenAPIReception AIAPI referenceChangelog
  • API reference
    • Introduction
    • Authentication
    • Streaming
  • ElevenAgents
  • ElevenAPI
  • ElevenCreative
  • Core Resources
  • Workspace
      • GETGet service accounts
        • GETGet API keys
        • POSTCreate API key
        • DELDelete API key
        • PATCHUpdate API key
  • Legacy
LogoLogo
Login
Login
Connect
BlogHelp CenterAPI PricingSign up
WorkspaceService AccountsAPI Keys

Create API key

POST
/v1/service-accounts/:service_account_user_id/api-keys
POST
/v1/service-accounts/:service_account_user_id/api-keys
$curl -X POST https://api.elevenlabs.io/v1/service-accounts/service_account_user_id/api-keys \
> -H "Content-Type: application/json" \
> -d '{
> "name": "string",
> "permissions": [
> "text_to_speech"
> ]
>}'
1{
2 "xi-api-key": "string",
3 "key_id": "string"
4}
Create a new API key for a service account
Was this page helpful?
Previous

Delete API key

Next
Built with

Path parameters

service_account_user_idstringRequired

Headers

xi-api-keystringOptional

Request

This endpoint expects an object.
namestringRequired
permissionslist of enums or "all"Required
The permissions of the XI API.
character_limitinteger or nullOptional
The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.
allowed_ipslist of strings or nullOptional

List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. ‘10.0.0.0/24’) or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the whitelist unchanged, or pass “clear” to remove it.

Response

Successful Response
xi-api-keystring
key_idstring

Errors

422
Unprocessable Entity Error