Model
WebSocket endpoint
Quickstart
Connect, configure the session, send a text message, and play the model’s spoken reply through your speakers: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).