Skip to main content

Maximum
xai/grok-4.20-reasoning/chat

xAI Grok 4.20 Reasoning chat endpoint: 2,000,000-token context window, image_url vision input, always-on reasoning (low to xhigh), tool calling, and 200K tiered token billing.

Input $1.1125Output $2.225per 1 million tokensCached input $0.178Prompts over 200K tokensInput $2.225Cached input $0.356Output $4.45

Workbench

Grok 4.20 Reasoning

What can Grok 4.20 Reasoning help with?

Missing the model you need?

2M-CONTEXT REASONING CHAT API

Grok 4.20 Reasoning API at a glance

xAI's dedicated reasoning model with a 2,000,000-token context window, vision, tool calling, and four effort tiers.

Input context
2M
Grok 4.20 Reasoning accepts up to 2,000,000 tokens per call.
Reply ceiling
2M
Grok 4.20 Reasoning max_tokens reaches 2,000,000 (default 4,096).
Effort levels
4
Grok 4.20 Reasoning effort options: low, medium, high, xhigh (default high).
Tools per call
128
Grok 4.20 Reasoning accepts 128 tool schemas with parallel calls.
Input types
2
Grok 4.20 Reasoning reads text and image_url in one turn.
Streaming
SSE
Grok 4.20 Reasoning streams incremental replies over SSE.

Results

What Grok 4.20 Reasoning is good at

  • 2M context

    Two million tokens in one conversation

    Grok 4.20 Reasoning accepts up to 2,000,000 input tokens, enough for full monorepos, multi-week incident logs, or entire compliance archives in a single call. Prompts above 200,000 tokens switch to the long-context tier.

  • Always-on reasoning

    Four dedicated effort dials from low to xhigh

    Reasoning stays active on every turn with reasoning_effort choices of low, medium, high (default), and xhigh. Reasoning tokens count inside max_tokens and appear in billed output.

  • Vision & tools

    Inspect images and drive up to 128 functions

    Attach image_url parts alongside logs or code, define up to 128 tools with parallel calls, and request structured JSON via response_format.

Before you run it

What to know before you run Grok 4.20 Reasoning

Chat
Grok 4.20 Reasoning allows 2,000,000 input tokens across 256 messages and max_tokens from 1 to 2,000,000 (default 4,096).
Chat
On Grok 4.20 Reasoning, reasoning tokens count inside max_tokens, so tight limits at higher effort can end before visible text.
Chat
Grok 4.20 Reasoning prompts above 200,000 input tokens switch to the long-context tier shown on this page.
Chat
Live evaluation confirmed Grok 4.20 Reasoning completed all 24 adult creative-writing rungs without refusal; lawful use and zero content involving minors still apply.

Use cases

What to build with the Grok 4.20 Reasoning API

  • Distributed systems root-cause analysis

    Feed traces, service configs, and postmortem timelines together to isolate concurrency bugs and design idempotent state transitions.

  • Monorepo architecture and security audits

    Load related services, tests, and schemas inside the 2,000,000-token window and ask for cross-service risk findings cited by file.

  • Analytical research over huge document bundles

    Compare regulatory filings, transcripts, and chart images in one thread without summarizing away critical caveats.

Prompts

Grok 4.20 Reasoning prompt examples you can copy

  • Chat

    Trace a webhook and refund race condition

    Trace a race condition between a payment webhook retry and a manual refund job, and propose an idempotent state machine. Work from the event sequence I provide. Show every invalid state transition explicitly before writing the lock strategy.

    Why it works. This scenario exercises Grok 4.20 Reasoning on multi-step concurrency analysis and state-machine verification before proposing implementation code.

    Try this prompt

Pricing

Grok 4.20 Reasoning API pricing

From $1.11 per million input tokens and $2.23 per million output tokens.

Get started

How to use the Grok 4.20 Reasoning API in three steps

  1. Step 1

    Watch the 200K long-context pricing threshold

    Prompts up to 200,000 input tokens use standard rates; prompts above 200,000 tokens move to the long-context tier. Keep stable prefixes early to maximize cache reads.

  2. Step 2

    Leave headroom in the output limit for thinking

    Because Grok 4.20 Reasoning always thinks before replying and counts thinking inside max_tokens, set max_tokens generously above the visible length you expect.

  3. Step 3

    Start at high, step down to low or medium for speed

    Use high or xhigh on multi-file debugging and mathematical verification, and step down to low or medium for shorter structured steps.

Parameter reference and code samples are in the API and Readme tabs at the top of this page.

FAQ

Grok 4.20 Reasoning API FAQ

About Grok 4.20 Reasoning

Grok 4.20 Reasoning combines xAI's always-on reasoning with a 2,000,000-token context window, vision input, tool calling, and structured JSON in one OpenAI-compatible chat call. Plan around the 200,000-token tier boundary and budget max_tokens for both thinking and final output.

Related models and next tasks