WebSocket overview

Relay session audio to your WebSocket backend or create an audio-only session.

View as Markdown

WebSocket commands connect a session to your wss:// backend for bidirectional audio and text frames. Choose a sidecar relay when the WebSocket should observe or participate in one existing call. Choose a standalone WebSocket session when the backend connection is the durable participant and needs to move between calls without reconnecting, such as an AI agent handling consecutive calls.

Command flow

Start the relay with Start a WebSocket audio relay. While it is active, you can pause, resume, mute or unmute, and flush buffered playback. Use Stop a WebSocket audio relay to end it deliberately.

Each control command returns 202 Accepted; provide an operation_uuid to associate its acknowledgement event. Follow WebSocket events for connection success, failures, text messages, and control acknowledgements. A phone session continues after its relay stops; a standalone session ends when its relay ends.