Overview
Aftersession_ready, the wire is a two-way stream:
- Client → server: binary audio frames, plus JSON control frames (
end_utterance,close). - Server → client: JSON
transcriptframes, plusack,backpressure,status, anderrorframes.
type field. Branch on it and ignore any message type or field you do not recognize.
Streaming audio (binary frames)
Send raw audio as binary WebSocket frames. Frames may be any length — the server re-frames the stream internally, so you do not need to align to segment boundaries. Send the encoding, sample rate, and channel count you declared in your config.Control frames (client → server)
Two JSON text frames let you control the session:ack confirming the durable high-water mark. Useful for push-to-talk, or before you pause.
transcript (server → client)
The server sends onetranscript frame per finalized segment of speech.
Always
"transcript".Monotonically increasing sequence number for this session. Use it to order and de-duplicate segments (helpful across a reconnect).
The finalized segment’s absolute time span:
{ "start": <seconds>, "end": <seconds> }. Includes any timeline_offset_seconds from your config.The ISO 639-1 language detected for this segment (for example
"de"), or null if undetermined.Whether speaker separation is on for this session. When
true, a speakers array is also present (see below).The transcribed text for the segment.
Per-word timings. Each entry is
{ "w": <word>, "start": <seconds>, "end": <seconds> }, on the same absolute timeline as segment.Only present when
diarization_enabled is true. Per-speaker turns within the segment — see Diarization.The absolute second up to which the server has consumed audio. This is your reconnection high-water mark — see Reconnection.
All times (
segment, words, and speaker turns) are on one absolute timeline that already includes your timeline_offset_seconds. You never need to add the offset yourself.Handling transcripts
Diarization (speakers)
When you enable diarization, eachtranscript frame carries a speakers array of per-speaker turns for that segment:
A stable label for a distinct speaker within the session (for example
"S1", "S2").Absolute start time of the turn.
Absolute end time of the turn.
The text attributed to that speaker for this turn.
ack (server → client)
Sent in response to anend_utterance control frame (and may be sent periodically in future). It confirms the durable high-water mark — the same meaning as processed_until on a transcript frame.
The absolute second up to which all audio has been consumed. A client can confirm its tail was processed before stopping or reconnecting. Content-free — clients that don’t need it can ignore it.
backpressure (server → client)
Sent when you are sending audio faster than the session can finalize it. Slow your send rate toward real time; if the pressure persists the server may drop some buffered segments to stay live.Severity of the signal (for example
"warn").How many buffered segments were dropped to keep the session live (
0 when this is only an early warning).A
backpressure frame may carry additional advisory numeric fields; treat them as opaque. The actionable response is always the same: send audio closer to real time. See Errors → Backpressure.status (server → client)
Informational session-state notifications.A short state label. For example
"idle_timeout" — the session received no audio for an extended period (roughly two minutes) and is being closed. Send audio, or end_utterance, periodically to keep a session alive.Next steps
Reconnection
Resume mid-recording with
processed_until and timeline_offset_seconds.Errors
Error frames, the full code table, and backpressure handling.