# 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

| Event | When | Fields |
| --- | --- | --- |
| `session.started` | After `session.start`. | `session`: `id`, `model`, `status`, `expires_at` and `audio`. |
| `session.updated` | After `session.update`. | `session`, as it now is. |
| `session.input_audio.muted`, `session.input_audio.unmuted` | After a mute or an unmute. | No other fields. |
| `session.output_audio.delta` | The model speaks. | `delta`: base64 24 kHz PCM16. With binary output, bare PCM16 in a binary message instead. No `event_id`. |
| `session.input_transcript.delta` | The 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.delta` | The model’s speech, as text. | `delta`, `start_ms`, `end_ms`; `done: true` on the last delta of a turn. |
| `session.turn.event` | The 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.warning` | Your 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.updated` | Once, just before the close. | `usage.seconds` and `context_window.usage_ratio`. |
| `session.closed` | The 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`. |
| `error` | An 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`.
