> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.telekesher.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.telekesher.dev/_mcp/server.

# WebSocket overview

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](/api/sessions/connect-websocket) 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](/api/web-socket/start). While it is active, you can [pause](/api/web-socket/pause), [resume](/api/web-socket/resume), [mute or unmute](/api/web-socket/mute), and [flush buffered playback](/api/web-socket/flush). Use [Stop a WebSocket audio relay](/api/web-socket/stop) to end it deliberately.

Each control command returns `202 Accepted`; provide an `operation_uuid` to associate its acknowledgement event. Follow [WebSocket events](/webhooks/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.