This guide will cover how input streaming works from the perspective of the Sonic-2 model. If you just want to implement input streaming, see the WebSocket API reference, which implements continuations using contexts.
Continuations
Continuations are generations that extend already generated speech. They’re called continuations because you’re continuing the generation from where the last one left off, maintaining the prosody of the previous generation. If you don’t use continuations, you get sudden changes in prosody that create seams in the audio.Prosody refers to the rhythm, intonation, and stress in speech. It’s what makes speech flow naturally and sound human-like.
Hello, my name is Sonic.It's very niceto meet you.

Figure 1: Generate transcripts independently & stitch them together.

Figure 2: Generate transcripts using continuations.
You can scale up continuations to any number of inputs. There is no limit.
Caveat: Streamed inputs should form a valid transcript when joined
This means thatHello, world! can be followed by How are you? (note the leading space) but not How are you?, since when joined they form the invalid transcript Hello, world!How are you?.
In practice, this means you should maintain spacing and punctuation in your streamed inputs.
Automatic buffering with max_buffer_delay_ms
When streaming inputs from LLMs word-by-word or token-by-token, we strongly recommend using the max_buffer_delay_ms parameter. This parameter sets the maximum time (in milliseconds) the model will wait and buffer text before starting generation.
How it works
When set, the model will buffer incoming text chunks until it’s confident it has enough context to generate high-quality speech, or the buffer delay elapses, whichever comes first. Without this parameter (or when set to 0), the model immediately starts generating with each input, which can result in choppy audio or unnatural prosody when inputs are very small (like single words or tokens).Configuration
- Range: Values between 0-1000ms are supported
- Default: 0 (no buffering)
max_buffer_delay_ms=500: ['Hello', 'my name', 'is Sonic.', "It's ", 'very ', 'nice ', 'to ', 'meet ', 'you.']