Docs / Live API / Server events

Live API

Server events

The events the Live socket sends. Every event except the audio deltas carries an event_id. Ignore event types you do not handle.

Events

EventWhenFields
session.startedAfter session.start.session: id, model, status, expires_at and audio.
session.updatedAfter session.update.session, as it now is.
session.input_audio.muted, session.input_audio.unmutedAfter a mute or an unmute.No other fields.
session.output_audio.deltaThe model speaks.delta: base64 24 kHz PCM16. With binary output, bare PCM16 in a binary message instead. No event_id.
session.input_transcript.deltaThe user’s speech, as text.delta, start_ms, end_ms, item_id, audio_start_ms. The delta that ends a user segment adds done: true, the whole transcript and audio_end_ms, and may carry an empty delta.
session.output_transcript.deltaThe model’s speech, as text.delta, start_ms, end_ms; done: true on the last delta of a turn.
session.turn.eventThe user or the model takes or gives the turn. An addition of .wave’s.audio_ms, and reasons: user_started_speaking, assistant_started_speaking, assistant_stopped_speaking, assistant_interrupted or assistant_yielded.
session.input_audio.warningYour audio arrived late, twice, or not at all. An addition of .wave’s.reason (late, duplicate or missing), audio_start_ms, and late_ms or missing_ms.
session.usage.updatedOnce, just before the close.usage.seconds and context_window.usage_ratio.
session.closedThe session has ended.reason: close_requested, expired or connection_lost; the final session and usage; detail, and stats with late_frames, missing_frames and duplicate_frames.
errorAn event was refused, or the server failed.error.type (invalid_request_error or server_error), code, message, param and client_event_id.

Timing fields

On transcripts, start_ms and end_ms count milliseconds from the session’s first input audio, and audio_ms on turn events uses the same clock, so transcripts and turns line up.

Why a session closed

session.closed.detail gives the specific reason: client_close, deleted, max_duration, idle_timeout, input_audio_overflow, protocol_error, server_shutdown or internal_error.