Text to Speech vs Text to Dialogue WebSockets
ElevenLabs exposes two families of WebSocket products for streaming synthesized speech. Each family has a single-stream variant and a multi-context variant that multiplexes several independent streams over one connection. They solve different problems, accept different message shapes, and target different models.
Which WebSocket should I use?
Use the Text to Speech (TTS) WebSocket when you stream plain text for one voice per connection (the voice is fixed in the URL) and you want non-v3 models such as Flash or Multilingual v2, optional SSML, chunk schedules, or the multi-context variant for agent-style interruption handling.
Use the Text to Dialogue (TTD) WebSocket when you need Eleven v3 dialogue behavior: expressive delivery, per-chunk voice_id, turn boundaries (new_turn), and the same dialogue-oriented buffering used for v3 on the server.
Use the TTD multi-context WebSocket when you need that same Eleven v3 dialogue behavior and several concurrent or interleaved streams on a single connection — for example, a conversational agent that must interrupt and restart dialogue without opening a new socket each time.
For batch or HTTP streaming dialogue (full request in one call), use Create dialogue or Stream dialogue instead of a WebSocket.
Comparison
When the TTS WebSocket is the better fit
- You already integrate Flash or Multilingual v2 for latency or language coverage.
- You want one narrator voice per connection and a simple text-per-frame protocol.
- You need multi-context orchestration for barge-in and parallel utterances (multi-context guide).
See Generate audio in real-time for a full walkthrough of the TTS WebSocket.
When the TTD WebSocket is the better fit
- You target Eleven v4 dialogue (expressive tags, conversational pacing, multi-speaker lines).
- You stream scripted or LLM-generated dialogue where the speaking voice can change per line without opening a new connection.
- You want WebSocket-shaped incremental input with v4-only dialogue generation on the server.
For a hands-on walkthrough, use Realtime Text to Dialogue. Protocol details are in the API reference.
Multi-context WebSockets
Both products ship a multi-context variant that multiplexes several independent streams over a single WebSocket connection. Each context is identified by a client-chosen context_id, buffers its own text, and emits audio chunks tagged with that context_id. TTS contexts share the voice_id from the connection URL, while TTD contexts register their own voices and settings. Use this format when you need concurrent or interleaved generation with interruption handling — for example, a voice agent that must cancel an in-flight utterance and start a new one without tearing down the connection.
When the TTD multi-context WebSocket is the better fit
- You need Eleven v3 dialogue behavior (expressive delivery, per-chunk
voice_id, turn boundaries) and concurrent or interleaved streams on one connection. - You are building a conversational agent that must interrupt and restart dialogue without opening a new socket each time.
- You want to fan out several independent v3 dialogue sessions — for example, parallel scenes or speakers — over a single authenticated connection.
For the single-stream TTD WebSocket, see Realtime Text to Dialogue. For the TTS multi-context WebSocket, see the Multi-context WebSocket guide. Protocol details for the TTD multi-context endpoint are in the API reference.