Cartesia API
by docs.cartesia.ai
Speech, image and audio
Added on November 3rd, 2026
Checked and working on November 3rd, 2026
Visit docs.cartesia.ai →
What it does
The Cartesia API offers fast text-to-speech and speech-to-text, for example to give a voice agent spoken answers. A POST request with a JSON body (model, transcript, voice, output format) returns WAV, MP3 or raw audio; SSE and WebSocket streaming are also available. Requests need an Authorization: Bearer and a Cartesia-Version header. Free plan with 20,000 credits per month (text-to-speech uses about one credit per character); a commercial use license comes with paid plans. An official MCP server at https://mcp.cartesia.ai/mcp lets AI agents generate speech, transcribe audio and manage voices.
At a glance
- API key
- Needed, free · More APIs with a free key
- Pricing
- Free plan with 20,000 credits per month (text-to-speech uses about one credit per character); a commercial use license comes with paid plans.
- Commercial use
- Not on the free plan
- From the browser
- Yes (CORS)
- Formats
- JSON
- Interface
- REST, MCP
- Provider
- docs.cartesia.ai
- Last checked
- Working on November 3rd, 2026
More information: https://docs.cartesia.ai/api-reference/tts/bytes
Compare: ElevenLabs API vs Cartesia API
Is this your service? Show that it is listed
Put this badge on your website or in your README; it links to this page. About the badge
Example request
curl
curl -X POST 'https://api.cartesia.ai/tts/bytes' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Cartesia-Version: 2026-08-14' \
-H 'Content-Type: application/json' \
-d '{"model_id":"sonic-3","transcript":"Hello, world!","voice":{"mode":"id","id":"db6b0ed5-d5d3-463d-ae85-518a07d3c2b4"},"output_format":{"container":"mp3","sample_rate":44100,"bit_rate":128000}}'
JavaScript
const response = await fetch("https://api.cartesia.ai/tts/bytes", {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Cartesia-Version": "2026-08-14",
"Content-Type": "application/json",
},
body: JSON.stringify({"model_id":"sonic-3","transcript":"Hello, world!","voice":{"mode":"id","id":"db6b0ed5-d5d3-463d-ae85-518a07d3c2b4"},"output_format":{"container":"mp3","sample_rate":44100,"bit_rate":128000}}),
});
const data = await response.json();
console.log(data);
Python
import requests
response = requests.post(
"https://api.cartesia.ai/tts/bytes",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Cartesia-Version": "2026-08-14",
"Content-Type": "application/json",
},
json={
"model_id": "sonic-3",
"transcript": "Hello, world!",
"voice": {
"mode": "id",
"id": "db6b0ed5-d5d3-463d-ae85-518a07d3c2b4",
},
"output_format": {
"container": "mp3",
"sample_rate": 44100,
"bit_rate": 128000,
},
},
timeout=30,
)
print(response.json())
Replace YOUR_API_KEY with your own key. The JavaScript works in a web page as well as in Node.js 18 or newer.