跳转到主要内容
推理模型在生成最终回答前,会花额外算力跑一遍隐藏的”思考”过程。 它们更慢、更贵,但能解决更难的问题。OrcaRouter 给出统一的语法 来控制各服务商的推理 effort——挑选适合你客户端的形式即可。

设置 effort 的两种方式

1. reasoning_effort 字段(OpenAI 形态)

在 Chat Completions 请求上传入。可选值:lowmediumhigh (某些模型还支持 minimal / max)。
resp = client.chat.completions.create(
    model="anthropic/claude-opus-4.6",
    messages=[{"role": "user", "content": "Hard math problem..."}],
    reasoning_effort="high",
)
OrcaRouter 会把这一字段翻译到上游的原生形态:
  • OpenAI o 系列与 gpt-5-pro 系列:原样转发为 reasoning_effort
  • Anthropic Claude:映射为 thinking: {type: "enabled", budget_tokens: ...},对应预算 low→1280、medium→2048、high→4096。claude-opus-4.6 特殊: 映射为 thinking: {type: "adaptive"} + output_config.effort
  • Google Gemini:映射为 generationConfig.thinkingConfig, 设置 includeThoughts: true 以及与 effort 对应的 thinking 等级 / 预算。
  • xAI Grok:在 grok-3-mini 系列上原样转发(它原生接受 reasoning_effort)。
  • DeepSeek reasoner:本身就是推理模型;reasoning_effort 不起作用。

2. 模型名后缀 -{effort}

也可以把 effort 直接编进模型名。识别的后缀: -minimal / -low / -medium / -high / -max
# 等价于 model="anthropic/claude-opus-4.6" + reasoning_effort="high"
resp = client.chat.completions.create(
    model="anthropic/claude-opus-4.6-high",
    messages=[...],
)
跨服务商行为一致——挑代码里更可读的那种写法即可。

本部署中的推理模型家族

OpenAI:
  • openai/o1o1-pro
  • openai/o3o3-minio3-mini-high
  • openai/o4-minio4-mini-high
  • openai/gpt-5-pro 以及 gpt-5.x-pro 系列
Anthropic(Claude 4 / Opus 上的 extended thinking):
  • anthropic/claude-sonnet-4.6claude-opus-4.6claude-opus-4.7 等——配合 reasoning_effort-{effort} 后缀使用。
Google Gemini(Gemini 2.5 / 3.x 上的 extended thinking):
  • google/gemini-2.5-progemini-2.5-flashgemini-3-pro-preview 等——配合 reasoning_effort-{effort} 后缀使用。
DeepSeek:
  • deepseek/deepseek-reasoner —— 本身就是推理模型。
xAI Grok:
  • grok/grok-4-fast-reasoninggrok-4-1-fast-reasoning
  • grok/grok-3-mini 配合 reasoning_effort: lowhigh
调用 /v1/models 获取实时目录。

响应中的推理轨迹

对于 OpenAI Responses API,模型的隐藏推理以 reasoning 项的形式 出现在响应输出里。对于通过原生 /v1/messages 调用的 Anthropic, thinking 以 type: thinkingcontent_block 条目到达。网关也会 在上游提供 reasoning_content 时把它透出到 chat-completion 响应上。 你可以为透明性展示这些轨迹,或在生产环境中忽略它们。

计费

推理 token 在 usage 对象的 completion_tokens_details.reasoning_tokens 上单独计数——参阅 运维 / 计费与用量