Skip to main content
The WebSocket carries two frame types: binary frames (audio) from client to server, and JSON text frames in both directions.

Client → Server

Audio Data

Binary WebSocket frames containing raw audio bytes. No base64, no JSON wrapping. Recommended chunk size: 2048–8192 bytes. Smaller chunks reduce latency; larger chunks reduce round trips.

Control Messages

JSON text frames with a type field.
Unknown text frames are silently ignored.

Server → Client

All server messages are JSON text frames.

Transcription Result

Emitted for each recognized speech segment (partial or final).

Utterance End

Emitted on speaker pause (Deepgram). Empty transcript, is_final: true.

Error

Emitted on validation or connection errors. Connection closes shortly after.

Message Flow

interim_results=false (default) — server sends only final transcripts:
interim_results=true — server sends partials, then final:
Partials are best-effort and may revise. Only is_final: true results are stable.