返回模型列表
Grok 4.20 Reasoning
xaixai/grok-4.20-reasoning
供应商自营与 TheRouter 服务形态的差异
供应商自己运营时
xAI 将 Grok 4.20 Reasoning 作为原生 xAI API 模型提供,使用 xAI 自身的价格层级、reasoning token 计费、服务端工具,并说明 Grok 4.20 及更新模型会静默忽略 logprobs/top_logprobs。
在 TheRouter 上
TheRouter 通过 OpenAI 兼容 chat 端点提供固定的 xai/grok-4.20-reasoning 路由,价格来自 standard-models.yaml;该模型不暴露媒体生成、音频或 embeddings 端点。
API 使用指南
推理 Chat 调用
使用标准 OpenAI 兼容 chat completions 端点。当你需要稳定的 Grok 4.20 推理行为而不是会变化的 latest 别名时,请固定模型 ID 为 xai/grok-4.20-reasoning。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-reasoning",
"messages": [
{"role": "system", "content": "Reason carefully, cite uncertainty, and give the shortest defensible answer."},
{"role": "user", "content": "Compare these two migration plans and identify the hidden failure modes."}
],
"reasoning": {"effort": "high"}
}'推理 + 函数调用
当模型需要判断调用哪个工具、检查结果并继续推进时,推理模式很有用。请保持工具 schema 精简,避免把 200 万上下文预算浪费在无关选项上。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-reasoning",
"messages": [{"role": "user", "content": "Find the risk score for customer c_123 and explain whether to escalate."}],
"tools": [{"type": "function", "function": {"name": "get_customer_risk", "description": "Return the current risk score for a customer", "parameters": {"type": "object", "properties": {"customer_id": {"type": "string"}}, "required": ["customer_id"]}}}],
"tool_choice": "auto",
"reasoning": {"effort": "medium"}
}'视觉推理
通过同一个 chat 端点发送 image_url 内容块,用于图表、截图、扫描文档以及需要基于证据推理的视觉问答。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-reasoning",
"messages": [{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "https://therouter.ai/assets/vision-sample.png"}},
{"type": "text", "text": "Identify the single highest-risk bottleneck and justify it."}
]
}],
"reasoning": {"effort": "medium"}
}'结构化推理输出
当下游系统需要直接消费结果时,把推理与 response_format: json_object 结合使用。模型内部仍会进行推理,但最终消息是可解析的 JSON。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-reasoning",
"messages": [{"role": "user", "content": "Return a risk matrix for migrating a healthcare support bot."}],
"response_format": {"type": "json_object"},
"reasoning": {"effort": "medium"}
}'事实档案 — 本页每条断言可在此回溯来源
| 来源 | URL | 采集于 | |
|---|---|---|---|
| 发布日期(公开 API) | — | — | 未知 |
| API 模型标识(固定版本) | docs.x.ai ↗ | 2026-07-31 | 已核实 |
| 推理模式 | docs.x.ai ↗ | 2026-07-31 | 已核实 |
| 上下文窗口 | docs.x.ai ↗ | 2026-07-31 | 已核实 |
| 最大生成 token 数 | — | — | 已核实 |
| 输入模态 | docs.x.ai ↗ | 2026-07-31 | 已核实 |
| 输出模态 | — | — | 已核实 |
| TheRouter 定价 | — | — | 已核实 |
| 上游公开定价 | docs.x.ai ↗ | 2026-07-31 | 已核实 |
| 函数调用 / 工具 | — | — | 已核实 |
| 结构化输出(response_format) | — | — | 已核实 |
| 知识截止日期 | — | — | 未知 |
| 许可 | — | — | 已核实 |
| BenchLM public score | benchlm.ai ↗ | 2026-07-26 | 未知 |
| Chatbot Arena Elo — Text Overall | benchlm.ai ↗ | 2026-07-26 | 未知 |
| SWE-bench Verified | benchlm.ai ↗ | 2026-07-26 | 未知 |
| LiveCodeBench Pro | benchlm.ai ↗ | 2026-07-26 | 未知 |
| Terminal-Bench 2.0 | benchlm.ai ↗ | 2026-07-26 | 未知 |
| DeepSearchQA | benchlm.ai ↗ | 2026-07-26 | 未知 |
| ARC-AGI-2 | benchlm.ai ↗ | 2026-07-26 | 未知 |
| GPQA Diamond | benchlm.ai ↗ | 2026-07-26 | 未知 |
| HLE without tools | benchlm.ai ↗ | 2026-07-26 | 未知 |
| MMMU-Pro | benchlm.ai ↗ | 2026-07-26 | 未知 |
| CharXiv Reasoning | benchlm.ai ↗ | 2026-07-26 | 未知 |
| BenchLM 验证 Grok 4.20 Reasoning 档案,包含 19 条公开基准记录 | benchlm.ai ↗ | 2026-07-26 | 已核实 |
| xAI 文档列出 Grok 4.20 定价与兼容性注意事项 | docs.x.ai ↗ | 2026-07-31 | 已核实 |
| 什么时候应选择 xai/grok-4.20-reasoning 而不是 xai/grok-4.20-non-reasoning? | benchlm.ai ↗ | 2026-07-26 | 待核实 |
| 新的 xAI 工作负载应使用 Grok 4.20 Reasoning 还是 Grok 4.3? | benchlm.ai ↗ | 2026-07-26 | 待核实 |