Skip to main content
REST and WebSocket reference for the realtime voice API. All routes are prefixed with /v1/realtime. For a guided walkthrough, see Speech to Speech.

WebSocket connection

WebSocket endpoint
Establishes a realtime voice session. The connection upgrades from HTTP GET (status 101) and then exchanges JSON events for session configuration, audio streaming, and responses.Query parametersSubprotocolsAuthenticationEither an Authorization: Bearer <API_KEY> header (server-side), or an ephemeral key (bai-eph-…) passed via subprotocol (client-side). Ephemeral keys are minted with POST /v1/realtime/client_secrets.WebSocket close codes

WebRTC

WebRTC transport support is in progress. WebSocket is the supported transport today.