Server Messages
The messages Flux TTS sends back on /v2/speak at Early Access — Connected, lifecycle and metadata events, warnings, errors, and the code reference.
The server replies to your Client Messages with JSON text frames interleaved with binary audio frames. This page documents every server-to-client message and the error/warning code reference.
Early Access surface. At EA the server emits the events below. Interruption reporting (SpeechInterrupted) and configuration responses (ConfigureSuccess / ConfigureFailure) are planned for GA alongside Interrupt and Configure.
Cadence at a glance: SpeechStarted marks the start of a turn and SpeechMetadata marks its end — every audio frame for a turn arrives between the two. Flush is your signal that all of the turn’s text has been sent; once it arrives, SpeechMetadata is our signal that all of the turn’s audio has been sent.
Connected
Sent immediately on a successful connection. Successor to v1/speak’s Metadata message.
SpeechStarted
Emitted at the start of each new turn, before audio streaming begins. Carries the server-assigned speech_id. Fires once per turn.
The speech_id is a server-minted identifier of the form dg_sp_<12 hex digits>. It is informational — useful for correlating logs.
When a turn becomes active. A Speak received while idle (the first Speak, or the first after a SpeechMetadata) starts a new active turn, and we emit SpeechStarted. There is only ever one active turn: a Speak received after you’ve Flushed the active turn but before its SpeechMetadata starts a pending turn. The active turn stays active until its SpeechMetadata — if you haven’t received SpeechMetadata, the turn is still being synthesized — at which point the next pending turn becomes active and gets its own SpeechStarted.
SpeechMetadata
Emitted once per turn, after we’ve sent all of the turn’s audio — our signal that synthesis for the turn is complete and no more audio is coming for it. It follows your Flush, which tells us no more text is coming for the turn. Reports billing and timing for the completed turn.
Per-turn vs. cumulative. Per-turn counts are reported here, once per turn (at Flush). Cumulative totals are reported once, at session end, in SessionMetadata as total_*.
Flushed
Emitted when the turn’s buffer has actually been flushed after a manual Flush — not on receipt of the Flush, and it can be held back behind earlier pending turns. The turn’s SpeechMetadata follows.
SessionMetadata
Final server message before the WebSocket closes. Reports cumulative session totals — the sum across all turns.
This is the one place cumulative totals are reported. Combined with the per-turn numbers in SpeechMetadata, you get clean reconciliation: per-turn for granular tracking, plus a final authoritative total.
Warning
Informational message; synthesis continues and the connection is unaffected. Every warning carries a code and a human-readable description.
See the warning codes below. Warnings are not rate-limited — every occurrence is emitted.
Error
A fatal, server-originated error. Unlike a Warning, an Error is always followed by a WebSocket close.
See the error codes below.
Warning codes
All warning codes follow Deepgram’s SCREAMING_SNAKE_CASE convention; the session stays open in every case.
Additional warning codes (pronunciation and inline-control validation, markup stripping) are planned for GA with the features that emit them.
Error codes
Every error is fatal and is followed by a WebSocket close frame. Codes use Deepgram’s DOMAIN-NNNN convention.
Related resources
- Client Messages — the messages these respond to
- The Speech Lifecycle — how these events sequence across a turn
- Cross-Turn Context — voice consistency across turns