ElevenLabs API
Realistic AI text-to-speech and voice cloning via a simple API.
What it does
ElevenLabs is a text-to-speech and voice API: realistic TTS in many languages, a large shared voice library, custom voice cloning, speech-to-speech, sound-effects generation and streaming audio for low-latency apps.
Base URL
Authentication
Create an account and copy your key from the profile page. Send it as the xi-api-key header (not a Bearer token). The free tier gives roughly 10,000 characters per month (about 10 minutes of audio), is non-commercial and requires attribution; paid plans remove both.
Code examples
curl -X POST "https://api.elevenlabs.io/v1/text-to-speech/JBFqnCBsd6RMkjVDRZzb" \
-H "xi-api-key: $ELEVENLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello from Larz OS","model_id":"eleven_multilingual_v2"}' \
-o hello.mp3import requests
voice_id = "JBFqnCBsd6RMkjVDRZzb"
r = requests.post(
f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}",
headers={"xi-api-key": KEY},
json={"text": "Hello from Larz OS", "model_id": "eleven_multilingual_v2"},
timeout=30)
open("hello.mp3", "wb").write(r.content)Rate limits & quotas
Usage is metered in characters, not requests: the free tier is about 10k/month, and paid tiers scale from ~30k to millions. There is also a concurrency limit (how many generations run at once) that rises with the plan. Over quota returns HTTP 401 with a quota_exceeded detail.
Key response fields
| (body) | MP3 (or requested format) audio bytes |
| voice_id | Identifier you pass in the URL — list them via GET /v1/voices |
| model_id | eleven_multilingual_v2, eleven_turbo_v2_5 (low latency), etc. |
| character_count / character_limit | From GET /v1/user/subscription — your usage |
Common errors
| 401 quota_exceeded | Monthly character allowance used up. |
| 401 | Missing or wrong xi-api-key header. |
| 422 | Invalid body — often a bad voice_id or model_id. |
| 429 | Too many concurrent generations for your plan. |
When to use it (and alternatives)
The go-to when voice quality matters — narration, agents, accessibility, dubbing. If you only need speech-to-text look at Deepgram or AssemblyAI; OpenAI also offers TTS bundled in its API.
FAQ
Can I use the free tier commercially?
No. The free plan is non-commercial and requires you to credit ElevenLabs. Any paid plan grants commercial rights to the audio you generate.
How do I get lower latency for a live app?
Use a turbo or flash model and the streaming endpoint (/stream), which returns audio chunks as they are generated instead of waiting for the whole clip.
How many characters is a minute of speech?
Roughly 900–1,000 characters per minute of natural narration, so the free 10k/month is about 10 minutes.
New to APIs?
Short guides for working with this API — and any other.
🛠️ Handy LarzOS tools
Free tools to help you work with this API.
Prompt ImproverLearn Prompt Engineering