Streaming
WebSocket protocol
Authentication, client messages, server events, and audio requirements for realtime transcription.
Connect to:
Send PCM16 little-endian, mono audio at 16 kHz as binary frames. Send control messages as JSON text frames.
Client messages
Configure the session after receiving ready:
To enable translation, set translate to true and provide target_language. Optional fields include translation_domain and translation_window_ms.
When the audio source ends, send {"type":"flush"} and wait for flushed before closing.
Server events
| Event | Meaning |
|---|---|
ready | The connection is authenticated and ready. |
speech_start / speech_end | Voice activity state changed. |
partial | Replaceable transcript draft. |
final | Stable transcript segment; may include word timestamps when requested. |
translation | Translation for one or more finalized segment IDs. |
translation_failed | Translation failed; the source final remains valid. |
flushed | Buffered audio has been finalized. |
error | The session cannot process a request or continue. |
See Realtime transcription, Realtime translation, and the Python realtime SDK.