A voice for your agent that starts talking before the reply is finished.
Stream your LLM’s tokens into one WebSocket and Iodine speaks each sentence as soon as it’s complete. The caller hears the first words while the rest of the answer is still being written.
Hear it
- < 200 ms to first audio for most requests
- 1 socket text in as it’s written, audio out
- $0.45 an hour of speech, nothing else
How it works
- 01
Connect
Open the realtime WebSocket from your server, with a voice and your API key.
- 02
Stream tokens
Send text as your LLM writes it. Complete sentences are spoken as they form.
- 03
Play the audio
Raw PCM comes back in order. Forward it to the call, the browser or your pipeline.
import asyncio, json, os
import websockets # pip install websockets
async def speak(llm_tokens):
async with websockets.connect(
"wss://api.iodine.dev/v1/tts/realtime?voice=katie",
additional_headers={"Authorization": f"Bearer {os.environ['IODINE_API_KEY']}"},
) as ws:
await ws.recv() # {"type": "ready", ...}
async for token in llm_tokens: # speak while the LLM writes
await ws.send(json.dumps({"type": "text", "text": token}))
await ws.send(json.dumps({"type": "close"}))
async for msg in ws:
if isinstance(msg, bytes):
play(msg) # 24 kHz 16-bit PCM: forward it to your call
elif json.loads(msg)["type"] == "done":
breakWhat you get
Barge-in built in
Send cancel when the user interrupts and speech stops at once, with buffered text dropped.
Learn more ›Works with your stack
A custom voice URL for Vapi, and a plain WebSocket that LiveKit and Pipecat agents connect to like any streaming voice.
Learn more ›Voices that act
v2 voices take cues like {happy} or {whisper}, in 40 languages, so an agent can sound like it means it.
Learn more ›Pay for audio, not seats
Each spoken piece is billed by the length of its audio. Failed requests cost nothing.
Learn more ›
What it costs
10,000 calls a month, with the agent speaking for two minutes in each.
20,000 minutes of speech on Iodine $150.00
The same at ElevenLabs v4 Turbo's published price $800.00
At Iodine’s pay-as-you-go prices. Other providers at their published pay-as-you-go rates; see the price comparison.
Questions
Most requests start returning audio in under 200 ms. On the realtime socket, a sentence is spoken as soon as it’s complete (at least 12 characters), so the first words play while your LLM is still writing.
Yes. Audio comes back as 24 kHz mono 16-bit PCM, which you can forward to your telephony provider or media server, resampling if it needs a lower rate.
Send {"type": "cancel"}. Speech stops straight away and any text still buffered is dropped, and you pay only for audio that was sent.
Yes. Point a Vapi assistant’s custom voice at Iodine, or connect a LiveKit or Pipecat agent to the realtime WebSocket from its server, as it would any streaming voice.
Start building with Iodine.
Top up from $5. No plan, seats or minimums.