init, configure, flush, and server events, see the Stream message layer.
Endpoint
Authentication
Authentication is provided via query parameters. Provide one of the following:
Example connection URLs:
Transport Model
- Send Stream JSON messages as WebSocket text frames.
- Send input audio as raw PCM bytes in WebSocket binary frames after receiving
configured. - Receive output audio as raw PCM bytes in WebSocket binary frames.
- Do not wrap audio in JSON or base64.
Connection Lifecycle
Audio Frames
Input audio and output audio use raw PCM binary frames on the WebSocket transport.- Encoding: 16-bit signed integer PCM (little-endian)
- Channels: Mono (1 channel)
- Input sample rate: Must match
input_sample_ratefrominit - Output sample rate: Matches
output_sample_ratefrominit
Error Handling
Connection Errors
If authentication fails, the server returns an HTTP error before the WebSocket upgrade:Runtime Errors
During a session, runtime errors are delivered aserror messages. Non-fatal errors, such as bad JSON or an unknown message type, do not close the connection. Fatal backend errors may be followed by the connection closing.
See error for the message shape.