AIDealsPro is reader-supported. If you buy through our links, we may earn a commission at no extra cost to you. Read How we review to see how we evaluate AI video and voice tools.
Yes. Send a POST request to https://api.elevenlabs.io/v1/text-to-speech/{voice_id} with your API key in the xi-api-key header, a voice ID and the text. A 100-character request costs 100 credits at 1 credit per character, and Starter costs $6/mo (checked 6 Nov 2026), with the first month shown at $1 until Nov 8 when checked on 6 Nov 2026.
Best for: Developers and creators who want to turn text into speech from code, a script, or an app without opening the ElevenLabs studio.
Not for: Anyone who only needs one voiceover now and then — the studio is faster than setting up an API key and a script.
Starting price: Starter $6/mo (checked 6 Nov 2026), first month $1 shown until Nov 8 when checked on 6 Nov 2026. See the full plan comparison.
ElevenLabs how to use API: what the API does
The ElevenLabs API is a way to use ElevenLabs from code instead of from the app. You send a request over the internet, ElevenLabs turns your text into audio, and your code saves the audio file. This ElevenLabs how to use API guide starts with that one request, because the rest is a variation on that pattern.
Three things make a request work. First, an API key, which proves the request is yours and tells ElevenLabs which plan to charge. Second, a voice ID, which picks the voice that speaks. Third, a model, which sets how the voice sounds — Eleven v3 and Eleven v4 are the current models for text to speech, and they cover 70+ and 90+ languages. Get the key first, because without it every request is refused.
If you do not have a key yet, follow our guide to getting an ElevenLabs API key before you go further. It covers where the key lives in the app, which plan you need, and how to keep the key safe. This guide picks up after that step: you have a key, and now you want to use it.
How to use the ElevenLabs API: your first request
Work through the steps in order. Each step names what it costs, and the first request is the one that proves the setup works.
Step 1: Get your API key
Get a key from the app at elevenlabs.io/app/developers/api-keys. The key is free on every plan, including Free, and it costs nothing to create. Store it as an environment variable called ELEVENLABS_API_KEY, and never paste it into code you share or post online.
Step 2: Find a voice ID
Pick a voice in the voice library and copy its voice ID, which is a long string of letters and numbers that identifies that voice. The ElevenLabs docs use the voice ID JBFqnCBsd6RMkjVDRZzb in their example, and you can use that ID for your first test, or use the ID of a voice you like better. Finding a voice ID costs nothing.
Step 3: Send your first request
Send a POST request to https://api.elevenlabs.io/v1/text-to-speech/{voice_id}, with your voice ID in place of {voice_id}. Add two headers: xi-api-key with your key, and Content-Type with the value application/json. The body of the request holds the text and the model, for example text “Hello, world.” and model_id “eleven_v3”. A 100-character request costs 100 credits at 1 credit per character.
Here is the same request as a curl command, using the docs example voice ID: 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, world.”, “model_id”: “eleven_v3”}’ –output hello.mp3
Step 4: Save the audio file
The API answers with audio, not with text. Save the response as an MP3 file — the curl command above does this with –output hello.mp3 — then play it to check the voice and the words. Saving costs nothing extra; you pay for the generation, not the download.
Step 5: Check your balance
Open the usage page in the app and check how many credits the request used. Credits are shared across ElevenLabs products, so a request that costs 100 credits leaves 100 fewer credits for the studio, for Music, and for agents.
Step 6: Run it again with a different voice or model
Change one thing at a time — the voice ID, the model, or the text — and send the request again. Each run costs the same number of credits as the first, so a 100-character test that you run three times costs about 300 credits. Keep the text you used, so you can compare voices on the same words.
Which model and voice settings to use
Use Eleven v3 for the most expressive voices and for audio tags, and Eleven v4 for the widest language cover at 90+ languages. Eleven v3 covers 70+ languages with a 5,000-character limit, and it is the model that handles tags such as [sings] and [laughing]. Our emotion tags guide lists the tags that work on v3 and v4 and shows how to write them.
Use Eleven Flash v2.5 when speed matters more than expression, because it carries a 50% lower per-character price than the standard models. For the voice itself, the body of the request can also carry voice_settings, which set stability and similarity for that voice.
How to list voices and find a voice ID
Send a GET request to https://api.elevenlabs.io/v2/voices with your key in the xi-api-key header. The answer is a list of voices, and each one carries a voice_id, a name, and a category. Pick the voice_id you want and use it in the text-to-speech address from Step 3. Listing voices costs nothing, because it does not generate audio.
You can also find a voice ID in the app, in the voice library, without the API. Open a voice, look at its details, and copy the ID shown there. Our guide to using a voice ID shows the exact clicks in the app and the API, and it explains the difference between a voice ID and an API key — the two are easy to mix up, and a request sent with one in place of the other will fail.
API errors and how to fix them
Four errors cover most failed requests. A 401 means the key is missing or wrong: check that the xi-api-key header is present, that the key matches the account you mean, and that you did not paste a voice ID in its place. If a key has been shared, generate a new one and delete the old one, because a shared key can spend your credits.
A 422 means the request itself is wrong: a voice ID that does not exist, an empty text field, or a model_id with a typo. Check the voice ID first, then the model name — “eleven_v3” and “eleven_v4” are the current model IDs for text to speech. A 429 means you hit a limit: concurrent requests are capped at 2 on Free, 3 on Starter, 5 on Creator and 10 on Pro, so wait a moment and spread your requests out instead of sending them all at once.
A payment error, or a request that returns no audio, usually means the plan is out of credits or the text is too long. Eleven v3 has a 5,000-character limit, so split a long script into short blocks and send each one as its own request.
What the API costs in ElevenLabs
The API costs the same as the studio: 1 credit per character with the standard model, and Eleven Flash v2.5 carries a 50% lower per-character price. The table below uses a 100-character request as the unit, and the prices are the plan prices read from the official pricing page — see the full plan comparison for the yearly prices. High-quality 44.1kHz PCM audio output through the API needs the Pro plan or above.
| Plan | Price | Credits | 100-char requests |
|---|---|---|---|
| Free | $0 (checked 6 Nov 2026) | 10,000 | About 100 |
| Starter | $6/mo (checked 6 Nov 2026) | 30,000 | About 300 |
| Creator | $22/mo (checked 6 Nov 2026) | 121,000 | About 1,210 |
| Pro | $99/mo (checked 6 Nov 2026) | 600,000 | About 6,000 |
The Starter first month is shown at $1 until Nov 8 when checked on 6 Nov 2026, instead of the usual $6/mo (checked 6 Nov 2026). That first month still includes the full 30,000 credits, so it covers about 300 requests of 100 characters each.
ElevenLabs API: pros and cons
Pros
• No studio needed — a script can generate speech on its own.
• The same request works for any voice, model or text.
• Flash v2.5 carries a 50% lower per-character price for speed.
• Credits are shared, so API use and studio use draw on one balance.
Cons
• A script that loops can empty a plan fast — 100 requests a day uses 10,000 credits a day.
• Errors come back as codes, not as plain-language fixes.
• High-quality 44.1kHz PCM output through the API needs Pro or above.
• A leaked key can spend your credits until you delete it.
Who should NOT use the ElevenLabs API
Skip the API if you only need a few voiceovers, or if you do not want to keep a key safe and watch a credit balance. The studio gives you the same voices with a play button and a download, and it needs no code at all. Use the API only when a script, an app, or a repeated job makes the setup worth it.
Frequently asked questions
How do I use the ElevenLabs API?
Send a POST request to https://api.elevenlabs.io/v1/text-to-speech/{voice_id} with your API key in the xi-api-key header, a voice ID, and the text in the body. Use model_id “eleven_v3” for your first request, save the audio answer as an MP3, and check your balance after it runs.
Where do I get an ElevenLabs API key?
Get a key in the app at elevenlabs.io/app/developers/api-keys. The key is free on every plan, including Free, and you can create more than one. Store it as an environment variable called ELEVENLABS_API_KEY, and never paste it into code you share or post online.
What is a voice ID in ElevenLabs?
A voice ID is a long string of letters and numbers that identifies one voice, and it goes in the address of a text-to-speech request. Find it with a GET request to https://api.elevenlabs.io/v2/voices, or copy it from the voice in the app. It is not the same as an API key.
How much does the ElevenLabs API cost?
The API costs 1 credit per character with the standard model, and Eleven Flash v2.5 carries a 50% lower per-character price. A 100-character request costs 100 credits. Starter costs $6/mo (checked 6 Nov 2026) for 30,000 credits, and Creator costs $22/mo (checked 6 Nov 2026) for 121,000 credits.
Why is my API request returning 401?
A 401 means the key is missing or wrong. Check that the xi-api-key header is present, that the key matches the account you mean, and that you did not paste a voice ID in its place. If the key has been shared, generate a new one and delete the old one.
Can I use the ElevenLabs API for free?
Yes. The Free plan includes 10,000 credits a month (checked 6 Nov 2026), which covers about 100 requests of 100 characters each, and the API key is free on every plan. Free plan use is non-commercial, and concurrent requests are capped at 2 on Free, against 3 on Starter and 5 on Creator.
Sources checked
• https://elevenlabs.io/pricing — plan prices and credit allowances (checked 6 Nov 2026)
• https://elevenlabs.io/docs — Text to Speech API reference, including the /v1/text-to-speech/{voice_id} endpoint and the /v2/voices list (checked 6 Nov 2026)
Last updated 6 Nov 2026. Prices checked on elevenlabs.io/pricing on that date; confirm at checkout.