Skip to main content
Choose an audio format that matches your source, then pick how the server decides when the user has finished speaking. The defaults work for most browser and desktop apps.

Audio formats

Set the format on input and output in session:
Send audio as base64 in input_audio_buffer.append. Send continuous frames, including silence, so the server can detect speech. Frames of about 100 ms work well.
For audio/pcmu and audio/pcma, send 8 kHz G.711 audio encoded as base64. The server decodes it.

Turn detection

audio.input.turn_detection controls when a user turn ends and the reply starts.

Server VAD (default)

Manual turns

Use manual mode for push-to-talk or when your app decides when to respond.
Send commit when the user releases the button, then response.create to get the reply.

Barge-in

The user can talk over the reply.
  • The server confirms the interruption from the transcript. Backchannels such as “ok” or “haan” do not cut off the reply.
  • When a real interruption is confirmed, the server emits input_audio_buffer.speech_started. Stop local playback at that point.
  • Tell the server how much audio the user heard with conversation.item.truncate so the next turn’s context matches what was played.

Transcription languages

The server transcribes user speech and replies in the language the user speaks, in its native script. Set audio.input.transcription.language to one code or an array of codes. Arrays are a 60db extension.
When you omit the field, the default is English and Hindi.