We use cookies to enhance your experience on the site
CodeWorlds
Back to collections
Guide12 min read

ElevenLabs, a voice that does not sound like a machine

ElevenLabs in practice: model choice, streaming, voice cloning, per minute voice agents, pricing from 5 to 990 dollars, and the legal questions.

ElevenLabs, a voice that does not sound like a machine

Speech synthesis sounded like speech synthesis for years: even, flat, and stressed in the wrong places. ElevenLabs is one of the companies that moved that boundary, and today the main question is not whether a natural voice can be generated but what it costs and what you may do with it.

The platform covers three areas: turning text into speech, cloning a voice, and agents conducting a phone conversation. Each bills differently, which is the first thing to understand before deployment.

Models and choosing between them

Several models offer different ratios of quality to latency and price, and picking the right one is the simplest cost optimisation available.

The fastest model generates speech with latency in the tens of milliseconds and suits real time conversation, where every tenth of a second registers. It also costs less per character, being billed more favourably.

The multilingual model gives higher quality and handles intonation better, so it suits recordings somebody will listen to end to end: narration for video, an audiobook, announcements in an application.

The newest generation emphasises emotional expression and supports more than seventy languages. The difference is most audible in dialogue and in content where flat reading would sound artificial.

The selection rule is simple: live conversation goes to the fast model, a recording played later to the higher quality one. Using the best model for everything is the most common reason a bill surprises people.

Your first call

Code
Bash
pnpm add @elevenlabs/elevenlabs-js
Code
TypeScript
import { ElevenLabsClient } from '@elevenlabs/elevenlabs-js'

const client = new ElevenLabsClient({ apiKey: process.env.ELEVENLABS_API_KEY })

const audio = await client.textToSpeech.convert('voice-id', {
  text: 'Your order has shipped and will arrive within two days.',
  modelId: 'eleven_flash_v2_5',
  outputFormat: 'mp3_44100_128'
})

Keep the key server side only. A call from a client component exposes it to anyone opening developer tools, and the bill lands on you. In a browser application, audio is fetched through your own server route.

Code
TypeScript
export async function POST(request: Request) {
  const { text } = await request.json()

  if (text.length > 500) {
    return new Response('Text too long', { status: 400 })
  }

  const audio = await client.textToSpeech.convert(VOICE_ID, {
    text,
    modelId: 'eleven_flash_v2_5'
  })

  return new Response(audio, {
    headers: {
      'Content-Type': 'audio/mpeg',
      'Cache-Control': 'public, max-age=31536000, immutable'
    }
  })
}

The length check on the second line is not excessive caution. A route without a limit lets anyone send a hundred thousand characters and charge your account with a single request. The cache header carries equally practical weight: the same message generated a second time costs the same as the first, so it is worth not generating it.

Choose the output format deliberately. Higher audio quality means a larger file and a longer download, and for interface announcements the difference between forty four and twenty four kilohertz is often inaudible.

Streaming

Generating a whole recording before playback means several seconds of silence. Streaming lets playback start before the rest exists.

Code
TypeScript
const stream = await client.textToSpeech.stream('voice-id', {
  text: content,
  modelId: 'eleven_flash_v2_5'
})

for await (const chunk of stream) {
  player.append(chunk)
}

This makes sense wherever a user waits. With a voice assistant the difference between two seconds of silence and an immediate start decides whether the conversation feels natural.

A separate pattern combines a stream from a language model with a speech stream. Sentences leaving the model go to synthesis piece by piece rather than waiting for the whole answer.

Code
TypeScript
let buffer = ''

for await (const chunk of modelStream) {
  buffer += chunk

  const boundary = buffer.search(/[.!?]\s/)
  if (boundary === -1) continue

  const sentence = buffer.slice(0, boundary + 1)
  buffer = buffer.slice(boundary + 2)

  await sendToSynthesis(sentence)
}

if (buffer.trim()) await sendToSynthesis(buffer)

The last line is the part most often skipped: without it the final sentence of an answer is lost whenever the model ended without a full stop. Splitting on sentence boundaries is necessary because synthesising a truncated sentence sounds wrong.

Voice cloning and the legal questions

The platform can build a voice from a recording, in two variants: a simplified one needing a minute of material, and a professional one needing tens of minutes and yielding a closer likeness.

Here begins the part no technology settles. A specific person's voice is their personal right, so cloning it without consent creates liability regardless of what the platform permits. The terms of service require you to hold rights to the recording, and responsibility for that rests with you.

For commercial use you need written consent covering scope and duration. A contract with a voice actor from five years ago for a recording does not cover training a model on their voice, so that needs revisiting separately.

Note too that commercial rights to generated audio depend on the plan. The free tier usually excludes them, so publicly released material requires a paid plan. That is the most common mistake when moving from a test to a deployment.

Voice agents

The third area is an agent conducting a conversation: it listens, understands, responds, and can call tools. It combines speech recognition, a language model, and synthesis into one pipeline.

Billing differs here from the rest of the platform, running per minute of conversation rather than per character. Rates start from a few to a dozen or so cents a minute depending on plan, and it is worth checking whether the language model cost is included or added separately.

Three things decide whether such an agent works. The first is interruption handling: a person speaks over it and the agent must fall silent immediately, otherwise the conversation becomes unbearable. The second is end to end latency, where exceeding roughly a second starts registering as awkward silence. The third is behaviour when the agent does not know, since handing the call to a person beats an invented answer.

For agent logic you can use the platform's own tooling or plug in your own, built for instance on the OpenAI Agents SDK or LangGraph, and use this service purely as the voice layer. A third route is an intermediary like Vapi, which wires speech recognition, the model and synthesis together itself and adds telephony, taking your key for this service as the voice source. The bill then becomes layered: the intermediary's rate covers orchestration alone, while speech recognition, model tokens, synthesis characters and the phone call bill separately, so the real cost per minute often runs several times the advertised one.

Controlling how it sounds

Default settings give a correct result rather than the best one for your application. A few parameters change the outcome more than switching voices does.

Stability governs how much successive generations of the same text differ. A high value gives predictable, calm reading, useful for system announcements. A low value gives more expression and variation, which sounds better in dialogue and worse in a repeated announcement.

Similarity states how closely the result holds to the reference voice. Setting it to maximum is sometimes counterproductive, since the model then carries over noise and flaws from the source recording.

The third parameter is style exaggeration, which amplifies a voice's distinctive traits. Handle it carefully, since past a certain point speech starts sounding like a parody of itself.

The three parameters described above are passed together with the text, and their values are worth settling once for the whole product rather than picking per call.

Code
TypeScript
const audio = await client.textToSpeech.convert(VOICE_ID, {
  text: content,
  modelId: 'eleven_multilingual_v2',
  voiceSettings: {
    stability: 0.5,
    similarityBoost: 0.75,
    style: 0.0,
    useSpeakerBoost: true
  }
})

The text itself is a separate control. Punctuation shapes pauses, and writing numbers out removes the most common reading error.

Code
TypeScript
const onScreen = 'Order 4471, amount 249.00 USD, delivery 12.08.'
const forReading = 'Order four four seven one. '
  + 'Amount two hundred forty nine dollars. '
  + 'Delivery on the twelfth of August.'

For production announcements, keep both versions in the code. The first goes to the screen, the second to synthesis, and trying to serve both from one string ends either in odd text on screen or odd sound in the headphones.

Dubbing and video material

The platform also handles translating and revoicing an existing recording while preserving the speaker's timbre. It is a separate pipeline: transcription first, then translation, then synthesis fitted to the utterance timing.

That last stage is harder than it looks. A sentence in one language can run over ten percent longer than in another, so fitting the original timing means either shortening the translation or speeding up speech. Automation does both, and on longer material the result deserves checking.

Practical advice: for marketing and training material treat the output as a draft for correction rather than a finished product. Fixing a few sentences where translation lost the sense takes less time than recording everything again and reaches a result automation will not achieve alone.

Pricing

PlanCostCredits per monthWho it suits
Free0 USD10kTesting, no commercial rights
Starter6 USD monthly30kSmall projects, commercial rights
Creator22 USD monthly121kRegular content production
Pro99 USD monthly600kHigher volume, higher quality
Scale and Business299 and 990 USD monthly1.8M and 6MProduction deployments, voice agents

Billing rests on credits, where one credit usually equals one character of text. Faster models consume fewer than higher quality ones, so model choice translates directly into how much content fits within a plan.

Overage is billed separately at a rate depending on plan. For a production deployment, measure the average announcement length and multiply by expected volume rather than guessing from the plan description.

A simple saving people often forget: caching. Repeated announcements, such as an application greeting or a standard confirmation, get generated once and stored as a file rather than produced on every playback.

Against the alternatives

OptionStrengthWeaknessPick it when
ElevenLabsVoice quality, cloning, agents includedCost at high volumeContent somebody listens to attentively
Google GeminiSpeech alongside other models in one APISmaller voice selectionProject already on that vendor
Local modelsNo per character cost, data stays with youLower quality, needs hardwareFull privacy requirement, high volume
System voiceNo cost, runs in the browserSounds like a machineA helper feature rather than the product

The last row is unfairly overlooked. For reading an article aloud on request, the browser's built in mechanism suffices and costs nothing. Paid synthesis makes sense where voice is part of the product rather than a convenience.

One question is worth asking when choosing: will anybody listen to this voice for longer than a few seconds. On a short confirmation in the interface the difference between solutions goes unnoticed. On a twenty minute training piece it decides whether anyone reaches the end, so that is where the money belongs.

The second question concerns volume. A solution billed per character at a million characters a day produces a bill against which a model run on your own infrastructure starts to look sensible, despite the lower quality. At a few thousand characters a day that arithmetic makes no sense, since the maintenance cost exceeds the saving.

Common mistakes

The first is a key on the browser side. An exposed key means somebody else's calls on your bill, and noticing usually takes a month.

The second is using the highest quality model for system announcements. Nobody hears the difference and credit consumption is many times higher.

The third is not caching repeated fragments. The same announcement generated a thousand times a day is a thousand charges for an identical result.

The fourth is publishing material generated on the free plan. Commercial rights attach to the plan, so releasing material without the right tier is a legal problem rather than a technical one.

The fifth is cloning a voice without written consent. The terms shift responsibility to you, and a recording found online is grounds for nothing.

The sixth is skipping interruption handling on a voice agent. An agent that keeps talking once the caller starts makes the conversation impossible to hold.

FAQ

What does ElevenLabs cost?

Plans begin at a free tier without commercial rights, through around five dollars a month for the entry variant, twenty two for the creator tier, ninety nine for the professional one, up to two hundred ninety nine and nine hundred ninety dollars for larger deployments. Billing rests on credits, where one credit is usually one character of text.

May I use a generated voice commercially?

Yes, on paid plans, which include commercial rights. The free tier usually does not grant them, so material intended for publication requires a plan. That is the most common trap when moving from a test to a deployment.

Is voice cloning legal?

Cloning your own voice or that of somebody who consented, yes. Cloning another person's voice without consent infringes their personal rights and the terms of service, and responsibility rests with whoever did it. Commercial use needs written consent covering scope and duration.

How well does it handle languages other than English?

Well, though quality depends on the model and the text. Abbreviations, numbers, and proper names are sometimes read wrongly, so for production announcements write them out or test them. The newest generation supports more than seventy languages and handles intonation noticeably better.

Can I build a voice agent on my own logic?

Yes, you can use this service purely as the recognition and synthesis layer and drive conversation logic with your own code or an agent library. End to end latency is the key concern in that arrangement, since three stages each add their own.

Documentation sits on the project site, and current price tiers appear on the pricing page.