Workflow
OpenAI voice transport, VAD and interruption
Choose a browser, server or phone transport and verify WebRTC authentication, turn detection and interrupted playback.
Sources checked:
What you can do
Test end-to-end audio and turn handling with the actual model and transport.
Keep the session endpoint, turn detection and audio playback responsibilities aligned with the transport.
Build your execution checklist
Inputs are processed in this browser only and cleared when you close or refresh the page.
You need WebRTC audio and want to keep the project API key on the server.
Read the full steps
Connect browser audio with the right session flow
You need WebRTC audio and want to keep the project API key on the server.
- Choose the documented model family and endpoint path. Current GPT-Live uses a server SDP exchange; for Realtime follow the unified interface or server-minted client secret flow.
- Keep the project API key server-side. For client secrets, authenticate your mint endpoint and avoid logging or persisting secrets in the browser.
- Test HTTPS microphone permission, ICE and data channel, received media, and reconnect after expiration. Record the specific failing stage.
Choose WebRTC, WebSocket or SIP
You know where audio originates and need one suitable transport.
- Use WebRTC for browser or mobile media and permission flows. Use WebSockets for server-controlled audio buffers and events.
- Use SIP for inbound telephone routing, and verify the exact telephony and callback flow supported by your model family.
- Test one happy path plus session disconnect, audio silence and reconnect using the same task in your chosen transport.
Choose and test voice activity detection
Your voice system cuts people off or waits too long.
- Check that your model/session supports turn detection. Some streaming transcription models require it omitted or null.
- Test server_vad for silence-based boundaries and semantic_vad for natural unfinished phrases. Record time to speech stop and the wrong-cutoff count.
- Repeat on pauses, filler words, background noise and fast speech. Tune the supported settings with the target language and microphones.
Make barge-in match what the user heard
The user interrupts and you need the model history to exclude unplayed speech.
- In a WebSocket client, stop playback on the interruption and measure how much of the latest assistant item played. Do not use the number of bytes received as playback duration.
- Send conversation.item.truncate with the current assistant item ID, audio content index and played audio_end_ms. For WebRTC or SIP follow the output buffer protocol for that transport.
- Interrupt during an audible sentence and ask a follow-up. Verify that the next response does not assume the unplayed part was heard.
Scope & limits
- Live and Realtime contracts differ. Test browser permissions and audio timing on your actual devices.
Verified sources
- WebRTC
- Create client secret
- WebSockets
- Telephony and SIP
- Voice activity detection (VAD)
- Realtime conversations
- Realtime client events
Templates are authored by Kunavo. External product behavior depends on the linked sources and your account settings.