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

# Claude 聊天对象

> 基于 2026-03-23 生产复核，理解 Anthropic Message 对象和原生 SSE 事件

> 更新日期：2026-06-06

# Claude 聊天对象

Crazyrouter 支持 Anthropic 原生 Messages API。

本文页只写入 `2026-03-23` 已在生产环境复核过的 Message 对象和流式事件类型。

## Message 对象

当前生产最小请求使用：

* `model: "claude-opus-4-8"`
* `POST /v1/messages`

当前生产返回的典型骨架：

```json theme={null}
{
  "id": "msg_xxx",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "..."
    }
  ],
  "model": "claude-opus-4-8",
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 15,
    "output_tokens": 20
  }
}
```

### 常看字段

| 字段            | 类型     | 说明                                        |
| ------------- | ------ | ----------------------------------------- |
| `id`          | string | 消息唯一标识                                    |
| `type`        | string | 固定为 `message`                             |
| `role`        | string | 固定为 `assistant`                           |
| `content`     | array  | 内容块列表                                     |
| `model`       | string | 实际使用的模型                                   |
| `stop_reason` | string | 停止原因，如 `end_turn`、`tool_use`、`max_tokens` |
| `usage`       | object | Token 用量                                  |

### content 常见块类型

文本块：

```json theme={null}
{
  "type": "text",
  "text": "..."
}
```

工具调用块：

```json theme={null}
{
  "type": "tool_use",
  "id": "toolu_xxx",
  "name": "get_time",
  "input": {
    "timezone": "Asia/Shanghai"
  }
}
```

思考块：

```json theme={null}
{
  "type": "thinking",
  "thinking": "..."
}
```

***

## 流式事件类型

`2026-03-23` 的生产复核中，`claude-opus-4-8` 原生流式返回了以下 SSE 事件：

* `message_start`
* `content_block_start`
* `content_block_delta`
* `content_block_stop`
* `message_delta`
* `message_stop`

### 事件示意

`message_start`

```text theme={null}
event: message_start
data: {"type":"message_start","message":{...}}
```

`content_block_start`

```text theme={null}
event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
```

`content_block_delta`

```text theme={null}
event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}
```

`content_block_stop`

```text theme={null}
event: content_block_stop
data: {"type":"content_block_stop","index":0}
```

`message_delta`

```text theme={null}
event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":20}}
```

`message_stop`

```text theme={null}
event: message_stop
data: {"type":"message_stop"}
```

***

## 一个实用判断

* 如果 `content` 里只有 `text`，就是普通回答
* 如果 `stop_reason = "tool_use"`，并且 `content` 里出现 `tool_use`，就是工具调用
* 如果 `content` 里出现 `thinking`，说明当前模型和请求形态触发了扩展思考

<Note>
  `thinking` block 不是所有 Claude 模型默认都会返回。当前明确复核成功的是 `claude-opus-4-8`。
</Note>

相关页面：

* [Claude 原生格式](/chat/anthropic/messages)
* [核心能力：Tool Calling](/features/tool-calling)
* [核心能力：Reasoning](/features/reasoning)
