Back to Models

Grok 4.20 Reasoning

xaixai/grok-4.20-reasoning

How TheRouter serves this differently from the vendor

As the vendor operates it

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.

On TheRouter

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
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
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
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
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
sourceURLretrieved
Release date (public API)β€”β€”unknown
API model slug (pinned)docs.x.ai β†—2026-07-31verified
Reasoning modedocs.x.ai β†—2026-07-31verified
Context windowdocs.x.ai β†—2026-07-31verified
Max completion tokensβ€”β€”verified
Input modalitiesdocs.x.ai β†—2026-07-31verified
Output modalitiesβ€”β€”verified
TheRouter pricingβ€”β€”verified
Upstream list pricingdocs.x.ai β†—2026-07-31verified
Function calling / toolsβ€”β€”verified
Structured outputs (response_format)β€”β€”verified
Knowledge cutoffβ€”β€”unknown
Licenseβ€”β€”verified
BenchLM public scorebenchlm.ai β†—2026-07-26unknown
Chatbot Arena Elo β€” Text Overallbenchlm.ai β†—2026-07-26unknown
SWE-bench Verifiedbenchlm.ai β†—2026-07-26unknown
LiveCodeBench Probenchlm.ai β†—2026-07-26unknown
Terminal-Bench 2.0benchlm.ai β†—2026-07-26unknown
DeepSearchQAbenchlm.ai β†—2026-07-26unknown
ARC-AGI-2benchlm.ai β†—2026-07-26unknown
GPQA Diamondbenchlm.ai β†—2026-07-26unknown
HLE without toolsbenchlm.ai β†—2026-07-26unknown
MMMU-Probenchlm.ai β†—2026-07-26unknown
CharXiv Reasoningbenchlm.ai β†—2026-07-26unknown
BenchLM verifies Grok 4.20 Reasoning profile with 19 public benchmark rowsbenchlm.ai β†—2026-07-26verified
xAI docs list Grok 4.20 pricing and compatibility caveatsdocs.x.ai β†—2026-07-31verified
When should I choose xai/grok-4.20-reasoning instead of xai/grok-4.20-non-reasoning?benchlm.ai β†—2026-07-26to verify
Should new xAI workloads use Grok 4.20 Reasoning or Grok 4.3?benchlm.ai β†—2026-07-26to verify
Help & contact