- Create a Dictation session before streaming.
- End the session after streaming.
is_final is true.
For related guides:
How Dictation streaming works
Suki for Partners Dictation streaming works as follows:- Create or reuse a Dictation session.
- Open a WebSocket connection to
GET /ws/transcribe. - Send one JSON message per audio chunk.
- Send an explicit end-of-audio message when the user stops speaking.
- Read partial and final transcript messages from the socket.
- Close the socket, then use End Dictation session to end the Dictation session. End does not return the transcript.
Before you connect
-
Create the Dictation session first, then open
GET /ws/transcribe. One speech stream can be open on thattranscription_session_idat a time. -
There is no partner status API for Dictation (
READY,IDLE,RUNNING). Do not poll those states. If another speech stream on the same session is still finishing, the handshake fails withFailedPrecondition(for example transcript session is not accepting new speech sessions). -
After you send
AUDIO_ENDand receiveEOF, wait about 5 seconds before you open the next WebSocket on the same session. Use that wait for push-to-talk and for reconnect after a drop.
Send JSON text frames
Every message you send on/ws/transcribe must be a UTF-8 JSON text frame.
- Each WebSocket frame must contain exactly one JSON object.
- Each client
sendshould contain one logical message. - Audio bytes go inside a JSON string field, not in a binary WebSocket frame.
Audio streaming recommendations
Sample Rate of 16 kHz
Stream Dictation audio at 16 kHz, which matches the capture rate used in the Dictation streaming examples.
Mono Channel
Send a single mono channel of audio, not stereo or multi-channel.
PCM_S16LE Encoding
Encode as PCM_S16LE (PCM signed 16-bit little-endian). Remove WAV headers or decode to raw PCM before you send.
About 100 ms per Chunk
For 16 kHz, mono, 16-bit audio, about 3200 bytes per chunk is about 100 ms of audio. Size chunks to your capture pipeline if your encoder differs.
Stream at Real-Time Speed
Pace audio chunks to match their actual duration and stream at or near real time, rather than sending buffered audio as fast as possible.
References
Wire Format
Message types, send order, example flow, and how to format and chunk audio.
Audio Capture Best Practices
Capture format, environment, gain, and network readiness before you stream.
Dictation Transcript Frames
Partial and final transcript messages, interim vs final commit, and insertion spacing.
Complete the Session
End the session after you finish reading WebSocket frames. End returns an empty body.
Dictation Streaming API
Endpoint details, handshake steps, and code samples for the Dictation WebSocket.
Available cookbooks
Available tutorials
Next steps
Continue in this order: Open Dictation streaming wire format for message types, send order, and audio chunking. Read Dictation transcript frames to handle partial and final transcript messages in your UI. Follow Complete the session after streaming to close the socket and end the session. Keepis_final transcript frames from the WebSocket.