> ## Documentation Index
> Fetch the complete documentation index at: https://docs.60db.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Client Events

> Events your app sends over the Realtime WebSocket, with their fields

Send these JSON events as text frames on the [Realtime WebSocket](https://docs.60db.ai/realtime/api-reference/websocket.md). Field names and shapes follow the OpenAI Realtime GA protocol. Each event has a `type` field and may include an optional `event_id`.

## Session

| Type | Purpose | Fields |
| - | - | - |
| `session.update` | Change the session config. Send before streaming audio | `session` (object): `type` (`realtime`), `model`, `output_modalities`, `instructions`, `audio`, `tools`, `tool_choice`, `memory`, `knowledge`, `intent` |

```json theme={null}
{
  "type": "session.update",
  "session": {
    "type": "realtime",
    "output_modalities": ["audio"],
    "instructions": "You are a friendly voice assistant.",
    "audio": {
      "input": { "turn_detection": { "type": "server_vad", "silence_duration_ms": 1000 } },
      "output": { "voice": "YOUR_VOICE_ID" }
    }
  }
}
```

## Input audio buffer

| Type | Purpose | Fields |
| - | - | - |
| `input_audio_buffer.append` | Add audio to the input buffer | `audio` (string): base64 audio in the configured input format |
| `input_audio_buffer.commit` | End the current user turn. Needed in manual turn mode | none |
| `input_audio_buffer.clear` | Discard buffered audio that is not committed | none |

```json theme={null}
{ "type": "input_audio_buffer.append", "audio": "<base64 PCM16 mono, 24 kHz>" }
```

## Conversation items

| Type | Purpose | Fields |
| - | - | - |
| `conversation.item.create` | Add a message or a function result to the history | `item` (object), optional `previous_item_id` |
| `conversation.item.retrieve` | Fetch an item | `item_id` |
| `conversation.item.truncate` | Cut off assistant audio the user did not hear | `item_id`, `content_index`, `audio_end_ms` |
| `conversation.item.delete` | Remove an item from the history | `item_id` |

Add a user text message:

```json theme={null}
{
  "type": "conversation.item.create",
  "item": {
    "type": "message",
    "role": "user",
    "content": [{ "type": "input_text", "text": "I prefer short answers." }]
  }
}
```

Return a function result:

```json theme={null}
{
  "type": "conversation.item.create",
  "item": { "type": "function_call_output", "call_id": "call_abc123", "output": "{\"status\":\"shipped\"}" }
}
```

## Responses

| Type | Purpose | Fields |
| - | - | - |
| `response.create` | Start a model reply now | optional `response` (object) with per-response overrides |
| `response.cancel` | Stop a reply in progress | optional `response_id` |

> [!NOTE]
>
> Out-of-band responses (`response.create` with `conversation: "none"`) are not supported yet.

## Ordering

* Send `session.update` before the first `input_audio_buffer.append`.
* Send `response.create` after you add a function result. With `server_vad`, the server also starts replies on its own when the user stops speaking.
* In manual turn mode, send `input_audio_buffer.commit` and then `response.create` for each turn.

## Related

* [Server events](https://docs.60db.ai/realtime/api-reference/server-events.md)
* [Function tools](https://docs.60db.ai/realtime/function-tools.md)
* [Audio and turn detection](https://docs.60db.ai/realtime/audio-and-turn-detection.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.