Grok 4.20 Reasoning
How TheRouter serves this differently from the vendor
xAI exposes Grok 4.20 Reasoning as a native xAI API model with xAI's pricing tiers, reasoning-token accounting, server-side tools, and the documented caveat that logprobs/top_logprobs are silently ignored for Grok 4.20 and newer.
TheRouter serves the pinned xai/grok-4.20-reasoning route through its OpenAI-compatible chat endpoint with TheRouter pricing from standard-models.yaml; unsupported media-generation, audio, and embeddings endpoints are not exposed for this model.
API guide
Reasoning chat
Use the standard OpenAI-compatible chat completions endpoint. Keep the model id pinned to xai/grok-4.20-reasoning when you need stable Grok 4.20 reasoning behavior instead of a moving latest alias.
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"}
}'Reasoning + tool calls
Reasoning mode is useful when the model must decide which tool to call, inspect the result, and continue. Keep tool schemas tight to avoid spending the 2M context budget on irrelevant options.
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"}
}'Vision reasoning
Send image_url content blocks through the same chat endpoint for charts, screenshots, scanned docs, and visual QA that needs reasoning over evidence.
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"}
}'Structured reasoning output
Combine reasoning with response_format: json_object when a downstream system has to consume the answer. The model still deliberates internally, but the final message is parseable JSON.
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"}
}'Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Release date (public API) | β | β | unknown |
| API model slug (pinned) | docs.x.ai β | 2026-07-31 | verified |
| Reasoning mode | docs.x.ai β | 2026-07-31 | verified |
| Context window | docs.x.ai β | 2026-07-31 | verified |
| Max completion tokens | β | β | verified |
| Input modalities | docs.x.ai β | 2026-07-31 | verified |
| Output modalities | β | β | verified |
| TheRouter pricing | β | β | verified |
| Upstream list pricing | docs.x.ai β | 2026-07-31 | verified |
| Function calling / tools | β | β | verified |
| Structured outputs (response_format) | β | β | verified |
| Knowledge cutoff | β | β | unknown |
| License | β | β | verified |
| BenchLM public score | benchlm.ai β | 2026-07-26 | unknown |
| Chatbot Arena Elo β Text Overall | benchlm.ai β | 2026-07-26 | unknown |
| SWE-bench Verified | benchlm.ai β | 2026-07-26 | unknown |
| LiveCodeBench Pro | benchlm.ai β | 2026-07-26 | unknown |
| Terminal-Bench 2.0 | benchlm.ai β | 2026-07-26 | unknown |
| DeepSearchQA | benchlm.ai β | 2026-07-26 | unknown |
| ARC-AGI-2 | benchlm.ai β | 2026-07-26 | unknown |
| GPQA Diamond | benchlm.ai β | 2026-07-26 | unknown |
| HLE without tools | benchlm.ai β | 2026-07-26 | unknown |
| MMMU-Pro | benchlm.ai β | 2026-07-26 | unknown |
| CharXiv Reasoning | benchlm.ai β | 2026-07-26 | unknown |
| BenchLM verifies Grok 4.20 Reasoning profile with 19 public benchmark rows | benchlm.ai β | 2026-07-26 | verified |
| xAI docs list Grok 4.20 pricing and compatibility caveats | docs.x.ai β | 2026-07-31 | verified |
| When should I choose xai/grok-4.20-reasoning instead of xai/grok-4.20-non-reasoning? | benchlm.ai β | 2026-07-26 | to verify |
| Should new xAI workloads use Grok 4.20 Reasoning or Grok 4.3? | benchlm.ai β | 2026-07-26 | to verify |