Best Text-to-Speech API: ElevenLabs vs OpenAI vs Cartesia

Picking a text-to-speech API looks easy until you ship. Every demo sounds good. The differences show up in production: how fast the first chunk of audio arrives when a user interrupts your agent, whether you can adjust a voice without re-recording anything, and how billing behaves at ten thousand requests a day.

This comparison covers the three APIs developers ask about most: ElevenLabs, OpenAI’s TTS endpoint, and Cartesia’s Sonic. They are not three versions of the same product. ElevenLabs is a voice platform built around expressive quality and cloning. OpenAI TTS is a compact REST API that slots into an existing OpenAI workflow. Cartesia is a latency-first engine built for real-time conversation. The right choice depends on what you are building, so let’s look at each one on its own terms first.

How this comparison is scored

Audio “quality” demos are subjective, so this comparison avoids ranking on vibes. It compares what you can verify from public documentation: how each API streams audio, how voices are controlled, which languages are covered, how input limits work, and how pricing is structured. Where a vendor publishes a latency number, it is attributed to the vendor, because model latency in a lab and end-to-end latency in your app are different measurements. Pricing is described qualitatively; all three change their plans, so check the official pricing pages before you commit.

ElevenLabs: the voice-quality platform with a real-time mode

ElevenLabs built its name on voices that sound human in long-form content, and the API reflects that. It effectively offers two personalities. The Flash models (Flash v2.5 is current) target real-time use, which ElevenLabs lists at around 75 ms of model latency. The Multilingual and v3 models trade speed for expressiveness and suit audiobooks, narration, and e-learning where nobody is waiting on the next turn.

Authentication is a single header, xi-api-key, against https://api.elevenlabs.io/v1. For live applications, the streaming endpoints are what matter. A /stream REST variant returns audio as it is generated, and a stream-input WebSocket endpoint accepts text fragments as they arrive, which pairs directly with tokens streaming out of an LLM. A chunk_length_schedule parameter controls the trade-off: smaller chunks reach the speaker sooner but can hurt prosody, larger chunks sound smoother but delay the first byte. Note that the older optimize_streaming_latency flag is marked deprecated in the API reference, so don’t build new code around it.

Voice control is where ElevenLabs pulls ahead of the other two. voice_settings exposes stability and similarity boost per request. Instant Voice Cloning builds a custom voice from a short sample, a Voice Design endpoint generates a voice from a text prompt, and a speech-to-speech endpoint re-voices existing recordings while keeping timing. SSML parsing is available for precise control.

One practical catch for developers: high-fidelity output formats are tiered. Higher subscription plans unlock formats like 192 kbps MP3, PCM, and WAV, so if your telephony or broadcast pipeline needs raw PCM, confirm your plan covers it before you design around it. ElevenLabs lists 32 languages on its flagship models, and pricing follows a per-character subscription model.

const response = await fetch(
  `https://api.elevenlabs.io/v1/text-to-speech/${voiceId}/stream?output_format=mp3_44100_128`,
  {
    method: "POST",
    headers: {
      "xi-api-key": process.env.ELEVENLABS_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model_id: "eleven_flash_v2_5",
      text: "Your return has been approved.",
    }),
  }
);
// response.body is a streaming audio body you can pipe to the client

OpenAI TTS: the simple pick inside the OpenAI stack

OpenAI’s speech endpoint is the least ceremonial of the three. One POST to https://api.openai.com/v1/audio/speech with a Bearer token, and three fields get you audio: model, input, and voice. If your app already calls OpenAI models, there is no new SDK, no new auth scheme, and no new vendor contract to think about.

Three models are available. tts-1 is the fast option, tts-1-hd aims at higher fidelity, and gpt-4o-mini-tts is the current default with the most features. The headline feature of gpt-4o-mini-tts is the instructions parameter, which takes natural-language direction for delivery, such as asking for a calm, measured tone for a meditation app or a brisk tone for navigation prompts. It does not work on the older two models.

The voice set is fixed at 13 built-in voices (alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse, marin, cedar), with marin and cedar documented as the recommended options. OpenAI’s voices are optimized for English, which matters if your users are not. For custom voices, OpenAI documents a voice creation flow: upload a consent recording, then create a voice from a sample and reference it by ID. Input is capped at 4,096 characters per request, speed adjusts from 0.25x to 4.0x, and output formats cover mp3, opus, aac, flac, wav, and pcm. Streaming works over chunked HTTP, including an SSE event format on the newer model.

The trade-off is architectural. A request/response REST API with chunked streaming is fine for narration, alerts, and content generation, but it is not designed for the sub-second turn-taking of a voice agent. Time to first audio will be higher than with socket-based engines, and there is no built-in way to feed LLM tokens into an open synthesis context.

curl https://api.openai.com/v1/audio/speech 
  -H "Authorization: Bearer $OPENAI_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"model":"gpt-4o-mini-tts",
       "input":"Welcome back. Your report is ready.",
       "voice":"marin",
       "instructions":"Speak in a calm, professional tone."}' 
  --output speech.mp3

Cartesia: the latency-first engine for voice agents

Cartesia’s Sonic line is built for one job: getting natural-sounding speech out of an LLM token stream as fast as possible. The current generation is Sonic-3.6, and Treat vendor numbers as a starting point: an independent community benchmark of an earlier Sonic release measured around 188 ms P50 end to end, which is still fast. The honest lesson is to budget against your own production measurements, not the landing page.

The API shape matches the job. The WebSocket TTS path opens a persistent context, you push transcript fragments with ctx.push() as the language model produces them, then signal no_more_inputs() and play back the returned audio chunks. This continuation pattern keeps prosody natural across fragment boundaries, which is the hard part of streaming TTS and the reason naive per-sentence synthesis sounds choppy in agents. REST generation exists for the offline case.

Cartesia lists 44 languages and documents voice cloning from roughly a 10-second clip. Output is aimed at engineers: raw PCM encodings (including 32-bit float) at 44.1 kHz, so you own the playback path end to end. SDKs cover Python, JavaScript, and Go, and there are native integrations with LiveKit and Vapi if you are building on those stacks. The broader platform includes Ink for speech-to-text and Line for voice-agent orchestration, so Cartesia is the only one of the three selling a full duplex voice pipeline. Pricing is credit-based per character. As the youngest company of the three, Cartesia is worth pairing with a fallback provider for anything mission-critical.

import os
from cartesia import Cartesia

client = Cartesia(api_key=os.environ["CARTESIA_API_KEY"])
audio = client.tts.generate(
    model_id="sonic-3.6",
    transcript="Hello from your Python application.",
    voice="db6b0ed5-d5d3-463d-ae85-518a07d3c2b4",
    output_format={
        "container": "wav",
        "encoding": "pcm_s16le",
        "sample_rate": 44100,
    },
)
audio.write_to_file("speech.wav")

Head-to-head: the technical comparison

ElevenLabs OpenAI TTS Cartesia Sonic
Primary strength Expressive quality, voice control Simplicity inside the OpenAI stack Real-time latency
Streaming model REST stream + WebSocket stream-input Chunked HTTP, SSE on newer model WebSocket continuation context
Latency posture Real-time tier (Flash) or studio tier (v3) Request/response, higher time to first audio Sub-90 ms marketed time to first audio
Voice control voice_settings, SSML, Voice Design instructions prompt (newer model only) Emotion/pace controls per request
Voice cloning Instant cloning, speech-to-speech Custom voices via consent + sample upload Cloning from ~10s clip (per docs)
Languages 32 on flagship models English-optimized 44
Input limit Per-request character limits by plan 4,096 characters per request Per-request limits by plan
Pricing model Per-character subscription tiers Per-character API pricing Per-character credit pricing
Best fit Narration, content, branded voices Existing OpenAI apps, simple REST needs Interruptible voice agents

How to choose: match the API to the workload

Building a real-time voice agent? Start with Cartesia. The continuation API is designed for exactly this: LLM tokens in, continuous audio out, with turn-taking that survives interruptions. ElevenLabs Flash is the alternative if you need its voice library or cloning and can accept slightly higher latency.

Producing narration, audiobooks, or video voiceover? ElevenLabs is the natural home. The studio models are tuned for long-form expressiveness, cloning lets you keep a consistent character voice across episodes, and nobody in this workload cares about 100 ms.

Already deep in the OpenAI ecosystem? OpenAI TTS removes an entire integration. If your use case is alerts, summaries read aloud, or content generation inside an app that already calls GPT models, the instructions parameter gives you surprising control for a three-field API. Reconsider only when conversation latency becomes the bottleneck.

Shipping an indie project or prototype? All three offer entry tiers, but evaluate on the axis that will hurt first: concurrent streams for agents, character volume for content, and whether high-fidelity formats sit behind a paywall. Run the same script through each, measure time to first audio from your own server, and let the numbers decide.

A final engineering note: whichever you pick, abstract the TTS call behind your own interface from day one. Voices, prices, and latency rankings change. The developers who can swap providers in an afternoon are the ones who never get stuck.

FAQ

Can I use these voices in commercial products?
Generally yes on paid tiers, but commercial use is governed by each provider’s terms and voice-rights policy. Read the terms before you ship, especially around cloned voices.

Which of the three is cheapest?
All three bill per character or credit, and plans change often enough that any number printed here would be stale within months. Estimate your monthly character volume, then compare the official pricing pages.

Do I need WebSockets for low-latency speech?
Not strictly, but the transport matters. Chunked HTTP starts the clock later than a warm socket, and only socket-based APIs let you stream LLM tokens into an open synthesis context. For interruptible agents, that is the deciding factor.

Sources

  • ElevenLabs API integration overview: https://www.cmarix.com/blog/elevenlabs-text-to-speech-api-integration/
  • Low-latency voice app architecture (ElevenLabs streaming details): https://aigcdev.com/en/articles/how-to-build-low-latency-voice-ai-apps-2026
  • OpenAI text-to-speech guide: https://developers.openai.com/api/docs/guides/text-to-speech.md
  • OpenAI speech API reference: https://developers.openai.com/api/reference/python/resources/audio/subresources/speech/methods/create/index.md
  • Cartesia real-time TTS quickstart: https://www.cartesia.ai/product/python-text-to-speech-api-tts
  • Community latency benchmark (Cartesia vs Deepgram vs ElevenLabs): https://dev.to/mrzitoun/benchmarking-real-time-voice-ai-apis-cartesia-vs-deepgram-vs-elevenlabs-2026-2n8c
  • Cartesia platform overview: https://www.anygen.io/showcase/cartesia-ai/index.html

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.