> ## 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.

# AI 思考字段

> 基于生产环境复核，理解 Crazyrouter 中不同协议暴露的 thinking/reasoning 字段

> 更新日期：2026-06-06

# AI 思考字段

本文页只列出 `2026-03-22` 已在 Crazyrouter 生产环境复核过的 thinking / reasoning 暴露方式。

一个关键前提是：不同协议暴露“思考”的方式并不相同。

* OpenAI Responses 更偏向返回独立的 `reasoning` item
* Claude 原生 Messages 返回 `thinking` block
* Gemini Native 当前更容易通过 `usageMetadata.thoughtsTokenCount` 判断思考是否生效

## 当前已验证字段

| 模型                | 协议                 | 已验证字段或标志                           | 说明                       |
| ----------------- | ------------------ | ---------------------------------- | ------------------------ |
| `gpt-5.5`         | Responses          | `output[].type = "reasoning"`      | 可配合 `summary` 拿到可展示的摘要   |
| `claude-opus-4-8` | Anthropic Messages | `content[].type = "thinking"`      | 与 `text` block 并列返回      |
| `gemini-3.1-pro`  | Gemini Native      | `usageMetadata.thoughtsTokenCount` | 说明 thinking budget 已实际消耗 |

<Note>
  在本轮复核中，`gpt-5.5` Chat Completions 的 `message.reasoning_content` 没有稳定返回可依赖内容，因此这里不把它列为主观察字段。
</Note>

***

## GPT: Responses `reasoning` item

```json theme={null}
{
  "output": [
    {
      "id": "rs_xxx",
      "type": "reasoning",
      "encrypted_content": "...",
      "summary": [
        {
          "type": "summary_text",
          "text": "..."
        }
      ]
    },
    {
      "type": "message",
      "content": [
        {
          "type": "output_text",
          "text": "最终回答"
        }
      ]
    }
  ]
}
```

提取方式：

```python theme={null}
response = client.responses.create(
    model="gpt-5.5",
    input="Which is larger, 9.11 or 9.9?",
    reasoning={"effort": "high", "summary": "detailed"}
)

for item in response.output:
    if item.type == "reasoning":
        for part in item.summary:
            if part.type == "summary_text":
                print("思考摘要:", part.text)
```

***

## Claude: `thinking` block

```json theme={null}
{
  "content": [
    {
      "type": "thinking",
      "thinking": "..."
    },
    {
      "type": "text",
      "text": "最终回答"
    }
  ]
}
```

提取方式：

```python theme={null}
message = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=320,
    thinking={
        "type": "enabled",
        "budget_tokens": 128
    },
    messages=[
        {"role": "user", "content": "Which is larger, 9.11 or 9.9?"}
    ]
)

for block in message.content:
    if block.type == "thinking":
        print("思考内容:", block.thinking)
    elif block.type == "text":
        print("回答:", block.text)
```

***

## Gemini: `thoughtsTokenCount`

Gemini Native 在当前复核中，最稳定的观察点不是正文里的可见思考文本，而是用量字段：

```json theme={null}
{
  "usageMetadata": {
    "thoughtsTokenCount": 120
  }
}
```

这说明：

* thinking budget 已实际参与生成
* 当前请求确实发生了思考 Token 消耗

提取方式：

```python theme={null}
data = response.json()
thoughts = data.get("usageMetadata", {}).get("thoughtsTokenCount", 0)
print("思考 Token:", thoughts)
```

***

## 使用时要注意

* 不要假设所有模型都会把完整思考过程明文返回
* 不要把不同协议的 thinking 字段混用
* 如果你要做审计、日志或前端展示，先按协议判断该读 `reasoning`、`thinking` 还是 `thoughtsTokenCount`

相关页面：

* [GPT-5 思考模式](/chat/responses/gpt5-thinking)
* [Claude 原生格式](/chat/anthropic/messages)
* [Gemini 原生格式](/chat/gemini/native)
