Events are sent as JSON text frames over the WebSocket. Every client event has a required
Create or update the session configuration. The first
Append an audio chunk to the input buffer. The audio must be encoded in the configured
Commit the buffered audio as a user turn (manual turn detection, i.e.
Discard all uncommitted audio in the input buffer. Acknowledged with
Add an item to the conversation — a text message, or a Supported
Fetch the server’s full copy of a conversation item by id — typically to inspect a user audio item (its audio content and transcript) as captured server-side, or to fetch an older item condensed away by
Truncate a completed assistant item to what the user actually heard — use it when your client stopped playback early, so the stored transcript matches the audio played. Acknowledged with
Remove an item from the conversation. Acknowledged with
Request a model response. Without a
Cancel the in-flight response. The cancelled response finishes with Constraints:
type and may carry an optional event_id (string; an identifier is generated when omitted). Unknown or malformed events produce an error event.session.update
Create or update the session configuration. The first session.update starts the session and is acknowledged with session.created; every later one is acknowledged with session.updated. An invalid configuration produces an error and the session is closed.string
required
Always
session.update.string
Client-chosen event identifier.
object
required
The session configuration object. The model comes from
session.model or, when it is omitted, from the connection URL’s ?model= query parameter; the first session.update fails if neither is set.input_audio_buffer.append
Append an audio chunk to the input buffer. The audio must be encoded in the configured audio.input.format. With server VAD, buffered audio is consumed automatically as speech is detected; with turn_detection: null, audio accumulates until input_audio_buffer.commit. The server does not acknowledge each append.string
required
Always
input_audio_buffer.append.string
Client-chosen event identifier.
string
required
Base64-encoded audio in the session’s input format. Maximum 1,048,576 base64 bytes per event (≈15 s of 24 kHz PCM16); larger chunks produce an
error.input_audio_buffer.commit
Commit the buffered audio as a user turn (manual turn detection, i.e. turn_detection: null). The server emits input_audio_buffer.committed, transcribes the audio, and adds the user item to the conversation (conversation.item.added). Committing does not generate a response — send response.create. Rejected with an error (type: "voice_output_task_ongoing") while a response is being generated.string
required
Always
input_audio_buffer.commit.string
Client-chosen event identifier.
input_audio_buffer.clear
Discard all uncommitted audio in the input buffer. Acknowledged with input_audio_buffer.cleared.string
required
Always
input_audio_buffer.clear.string
Client-chosen event identifier.
conversation.item.create
Add an item to the conversation — a text message, or a function_call_output returning a tool result. Acknowledged with conversation.item.added. Creating an item never triggers a response by itself; send response.create when you want one.string
required
Always
conversation.item.create.string
Client-chosen event identifier.
string | null
Id of the item to insert after. Omitted or
null appends at the end of the conversation. An unknown id produces an error (type: "invalid_previous_item_id").object
required
The item to add. See supported item types below.
item types:A client-supplied
item.id is preserved so the item can be addressed later (retrieve / truncate / delete); an id that already exists produces an error (type: "conversation_item_duplicate_id"). When omitted, the server generates one.conversation.item.retrieve
Fetch the server’s full copy of a conversation item by id — typically to inspect a user audio item (its audio content and transcript) as captured server-side, or to fetch an older item condensed away by conversation.context.summarized. Answered with conversation.item.retrieved, or an error (type: "conversation_item_not_found").string
required
Always
conversation.item.retrieve.string
Client-chosen event identifier.
string
required
Id of the item to fetch.
conversation.item.truncate
Truncate a completed assistant item to what the user actually heard — use it when your client stopped playback early, so the stored transcript matches the audio played. Acknowledged with conversation.item.truncated. In text-only sessions (output_modalities: ["text"]) this is a no-op acknowledged with audio_end_ms: 0.string
required
Always
conversation.item.truncate.string
Client-chosen event identifier.
string
required
Id of the assistant item to truncate.
integer
required
Index of the content part to truncate.
integer
required
Playback position, in milliseconds from the start of the item’s audio, at which to cut.
conversation.item.delete
Remove an item from the conversation. Acknowledged with conversation.item.deleted.string
required
Always
conversation.item.delete.string
Client-chosen event identifier.
string
required
Id of the item to remove.
response.create
Request a model response. Without a response body, the response is generated from the current conversation and session configuration. With server VAD, any in-flight response is interrupted first; with turn_detection: null, the request is rejected with an error (type: "voice_output_task_ongoing") while a response is active.string
required
Always
response.create.string
Client-chosen event identifier.
object
Per-response overrides.
response.cancel
Cancel the in-flight response. The cancelled response finishes with response.done (status: "cancelled").string
required
Always
response.cancel.string
Client-chosen event identifier.
string
When set, must match the active response’s id, else an
error (code: "response_id_mismatch"). When no response is active, an error (code: "response_not_active").Session configuration object
Passed assession in session.update:modelis optional when the connection URL carries?model=(an explicitsession.modeloverrides the URL); the firstsession.updatefails if neither is set. Usehiggs-realtime.output_modalitiesmust be exactly["audio"]or["text"].max_output_tokensintegers are clamped to4096;"inf"is unbounded.audio.*.format.typeis one ofaudio/pcm(rate: 8000 | 16000 | 24000 | 48000),audio/pcmu,audio/opus(frame_size_ms: 2.5 | 5 | 10 | 20 | 40 | 60).turn_detection.typeisserver_vadorsemantic_vad.- A non-
"default"voiceis validated against the voices API at update time; an unknown voice fails thesession.update. transcription.modelenables input transcription: set it tohiggs-stt-3.1to receiveconversation.item.input_audio_transcription.completedevents; when unset, no transcription events are emitted.languageis an optional ISO-639-1 hint.tools[]entries:{ "type": "function", "name", "description", "parameters" }.
Related
Server events
The events the server sends back in response to these.
Connections and sessions
How to connect, authenticate, and choose session settings.
Turn detection
When to commit audio yourself versus letting server VAD do it.
Tool use
Declaring tools and returning results with
function_call_output.