Skip to main content
The Realtime API enables real-time bidirectional voice communication over WebSocket (WebRTC support is in progress). Stream audio and text both ways for voice assistants, phone agents, and interactive voice systems: the model listens and speaks natively in a single full-duplex session — no separate transcription or synthesis steps to manage.
Model
WebSocket endpoint

Quickstart

Connect, configure the session, send a text message, and play the model’s spoken reply through your speakers:
The reply arrives as a stream of response.output_audio.delta events (base64 24 kHz 16-bit mono PCM) alongside response.output_audio_transcript.delta text, ending with response.done. To talk instead of type, stream microphone audio with input_audio_buffer.append — with server_vad turn detection the model detects when you stop speaking and responds on its own, no response.create needed. For browser apps, don’t ship your API key: mint a short-lived key with POST /v1/realtime/client_secrets and connect with the bai-client-secret.<key> subprotocol (see Authentication).