Introduction
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.
| Field | Value |
|---|---|
| Input | Text |
| Output | Text |
| Input budget | 2,000,000 tokens |
| max_tokens ceiling | 2,000,000 |
| Inputs | text / images |
Key features & highlights
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.
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.
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.
Request parameters
| Parameter | Required | Description |
|---|---|---|
messages | Yes | Ordered conversation history for Grok 4.20 Reasoning (up to 256 messages) supporting text and |
max_tokens | No | Maximum combined thinking and visible reply tokens for Grok 4.20 Reasoning (1 to 2,000,000, default 4,096). |
reasoning_effort | No | Reasoning depth for Grok 4.20 Reasoning: low, medium, high, xhigh (default high), where higher effort uses more output tokens and latency. |
stop | No | One stop sequence or up to four strings (32 characters each) that halt Grok 4.20 Reasoning output. at least 1 characters · at least 1 items · at most 4 items |
temperature | No | Sampling temperature for Grok 4.20 Reasoning from 0 to 2, where lower values yield steadier wording. |
top_p | No | Nucleus sampling threshold for Grok 4.20 Reasoning from 0.01 to 1, tuned independently from temperature. |
tools | No | Up to 128 OpenAI-format function definitions for Grok 4.20 Reasoning, with argument checks and execution handled by your app. at most 128 items |
parallel_tool_calls | No | Allows Grok 4.20 Reasoning to propose multiple independent tool calls in a single turn (on by default). Default: |
tool_choice | No | Controls whether Grok 4.20 Reasoning picks a tool automatically (auto), skips tools (none), requires a call (required), or calls a named function. |
response_format | No | Request plain text or structured JSON output from Grok 4.20 Reasoning, validating returned JSON in your application. |
Pricing
Input $1.1125 / Output $2.225 per 1 million tokens; Prompts over 200K tokens: Input $2.225 / Output $4.45
Use cases
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.
Prompt guide & pro tips
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.
Leave headroom in the output limit for thinking
Because Grok 4.20 Reasoning always thinks before replying and counts thinking inside
max_tokens, setmax_tokensgenerously above the visible length you expect.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.
Overview
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.
Limits and billing
Grok 4.20 Reasoning accepts up to 2,000,000 input tokens and 2,000,000 output tokens (default 4,096), billed per measured token at the live rates on this page.
grok/4.20-reasoning/chat
SpicyAPI adds no extra moderation layer to Grok 4.20 Reasoning; live testing across 24 adult-fiction prompts passed all romantic, explicit, BDSM, and horror rungs without refusal, while illegal content and anything involving minors remain prohibited.
API quick start
curl --fail-with-body -sN https://api.spicyapi.ai/v1/chat/completions \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "xai/grok-4.20-reasoning/chat",
"messages": [
{
"role": "user",
"content": "Summarise the following release notes into three bullet points."
}
],
"stream": true
}' \
| jq --unbuffered -Rrj 'select(startswith("data: ")) | .[6:] | select(. != "[DONE]") | fromjson | if .error then "\n[error] \(.error.message)\n" else (.choices[0].delta.content? // empty) end'
See the API reference for authentication, the complete schema, polling, and error handling.








