FIELD GUIDE

OpenAI Realtime Interruption: Canceling Speech Is Not the Same as Fixing Conversation History

The editorial decision

The caller interrupts a voice agent halfway through an answer. The server may already have generated the entire sentence, while the listener heard only three words. If the application retains the full answer in conversation history, its next turn can mistakenly assume the caller heard instructions that never played.

What primary documentation actually establishes

OpenAI’s Realtime API documents response cancellation, voice activity detection configuration and truncation of an assistant audio item. For WebRTC/SIP playback paths, the reference also distinguishes clearing an output audio buffer from canceling generation. Truncation specifically addresses mismatch between the server’s recorded dialogue and what reached the listener. Supported event names and sequence depend on transport and API version; producers must pin the request schema being used.

A concrete production workflow

During a customer-care call, track the audio chunk IDs, playback clock and user speech-start event. On barge-in, stop local playback, cancel the server response if one is running and apply supported truncation at the last confirmed audio timestamp. Then allow the new user turn to modify context. Keep tool side effects outside this automatic audio workflow: a refund already sent is not rolled back by response.cancel. Design critical actions around explicit confirmation and an idempotent transaction token.

Failure modes and limitations

Network queues can let audio play after the server stops generating. Semantic VAD can wait longer for hesitation than simple energy-threshold VAD, while an aggressive threshold cuts off soft-spoken users. The correct interruption threshold varies with microphone noise, language and accessibility needs. A successful cancel event is not proof that every downstream speaker or telephony buffer has been cleared.

A practical evidence and listening test

Simulate interruption at multiple points: before first audio, during a clause, after a completed sentence and during an external tool call. Compare replayed transcript, actual heard audio and server-side conversation context. Count ghost speech, repeated responses and accidental side effects. No Realtime connection was opened or bench test performed for this guide.

Rights, consent and responsible handling

Deploy explicit notification when audio is synthesized, and secure logs containing speech data. The assistant must not imitate a real person without authorization. Human escalation is required for sensitive or dangerous actions, and interrupted partial speech should not trigger a legally consequential confirmation.

Alternatives and buying decision

LiveKit and other agent orchestrators offer higher-level turn handling, while direct Realtime API integration gives lower-level control over events. Evaluate operational control and accessibility, then let AI 10 supply dated cost figures.

Sources & Further Reading

Editorial cutoff 25 October 2026. We have not performed live API testing or independent product benchmarking. Reconfirm your region, plan, model revision, licensing and current prices before deployment.

CONTINUE EXPLORINGExplore related files ↗