跳转到主要内容

AI 思考字段

本文页只列出 2026-03-22 已在 Crazyrouter 生产环境复核过的 thinking / reasoning 暴露方式。 一个关键前提是:不同协议暴露“思考”的方式并不相同。
  • OpenAI Responses 更偏向返回独立的 reasoning item
  • Claude 原生 Messages 返回 thinking block
  • Gemini Native 当前更容易通过 usageMetadata.thoughtsTokenCount 判断思考是否生效

当前已验证字段

模型协议已验证字段或标志说明
gpt-5.4Responsesoutput[].type = "reasoning"可配合 summary 拿到可展示的摘要
claude-opus-4-6-thinkingAnthropic Messagescontent[].type = "thinking"text block 并列返回
gemini-3-pro-previewGemini NativeusageMetadata.thoughtsTokenCount说明 thinking budget 已实际消耗
在本轮复核中,gpt-5.4 Chat Completions 的 message.reasoning_content 没有稳定返回可依赖内容,因此这里不把它列为主观察字段。

GPT: Responses reasoning item

{
  "output": [
    {
      "id": "rs_xxx",
      "type": "reasoning",
      "encrypted_content": "...",
      "summary": [
        {
          "type": "summary_text",
          "text": "..."
        }
      ]
    },
    {
      "type": "message",
      "content": [
        {
          "type": "output_text",
          "text": "最终回答"
        }
      ]
    }
  ]
}
提取方式:
response = client.responses.create(
    model="gpt-5.4",
    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

{
  "content": [
    {
      "type": "thinking",
      "thinking": "..."
    },
    {
      "type": "text",
      "text": "最终回答"
    }
  ]
}
提取方式:
message = client.messages.create(
    model="claude-opus-4-6-thinking",
    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 在当前复核中,最稳定的观察点不是正文里的可见思考文本,而是用量字段:
{
  "usageMetadata": {
    "thoughtsTokenCount": 120
  }
}
这说明:
  • thinking budget 已实际参与生成
  • 当前请求确实发生了思考 Token 消耗
提取方式:
data = response.json()
thoughts = data.get("usageMetadata", {}).get("thoughtsTokenCount", 0)
print("思考 Token:", thoughts)

使用时要注意

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