Grok 4.20 Reasoning overview
Grok 4.20 Reasoning specs
- Model ID
x-ai/grok-4-20-0309-reasoning- Developer
- xAI
- Context window
- 2,000,000 tokens
- Max output
- 1,999,000 tokens
- Input
- Image, Text
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
What is Grok 4.20 Reasoning API?
Grok 4.20 Reasoning, a large language model designed for advanced reasoning tasks. It excels at multi-step problem solving, logical analysis, and complex instruction following.
Where to Use Grok 4.20 Reasoning
Coding and code review
Generate, debug, and review code across languages, reading whole files or repos in a single prompt.
Use cases
Document understanding tasks: the model is documented as excelling at understanding documents, making it suited to reading, interpreting, and extracting meaning from text-heavy materials.
Long-horizon agentic tool calling: it is documented as strong for long-running agentic workflows, including extended tool use across multiple steps.
Coding and agents: one model listing explicitly describes it as best for “coding + agents,” indicating suitability for developer workflows that combine code generation with agent-style task execution.
Complex logic and math, scientific/technical analysis, and multi-step investigations: Oracle documents it as appropriate for higher-stakes reasoning work where accuracy matters, including these analytical use cases.
Capabilities
- Function calling
- Streaming
- Structured outputs
- Web search
Grok 4.20 Reasoning benchmarks by
Artificial Analysis
See how Grok 4.20 Reasoning scores on independent evaluations. Data retrieved Nov 3, 2026.
Benchmark results
Compare 12 models available on AI/ML API across 5 independent benchmarks.
Humanity's Last Exam
Expert-written questions across academic subjects.
GPQA Diamond
Graduate-level science questions written to resist web search.
AA-LCR
Reasoning across long documents of about 100k tokens.
IFBench
Following precise instructions about the shape of the answer.
τ²-Bench Telecom
Customer support agent tasks with tool calls.
Grok 4.20 Reasoning API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $1.25 | 1M tokens |
| Output | $2.5 | 1M tokens |
| Cached input | $0.2 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
Grok 4.20 Reasoning vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $1.25 | $2.5 | |
| $1 | $2 | |
| $2 | $6 | |
| $2 | $6 | |
| $2 | $6 |
How to use the Grok 4.20 Reasoning API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "x-ai/grok-4-20-0309-reasoning",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "x-ai/grok-4-20-0309-reasoning",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "x-ai/grok-4-20-0309-reasoning",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Related articles
Grok 4.20 Reasoning FAQ
What is the context window of Grok 4.20 Reasoning?
Grok 4.20 Reasoning has a 2,000,000 tokens context window and can return up to 1,999,000 tokens.
What inputs and outputs does Grok 4.20 Reasoning support?
Grok 4.20 Reasoning takes image, text as input and returns text.
What is the model ID for Grok 4.20 Reasoning?
Use x-ai/grok-4-20-0309-reasoning as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
How much does Grok 4.20 Reasoning cost?
Grok 4.20 Reasoning costs $1.25 input and $2.5 output per 1M tokens on AI/ML API, billed as you go with no subscription.
Does Grok 4.20 Reasoning support streaming?
Yes, Grok 4.20 Reasoning can stream responses as they are generated.
Can Grok 4.20 Reasoning read images?
Yes, Grok 4.20 Reasoning accepts image input alongside text.
Who created Grok 4.20 Reasoning?
Grok 4.20 Reasoning was built by xAI .
What kinds of tasks is Grok 4.20 Reasoning best suited for?
It is designed for advanced reasoning tasks, including multi-step problem solving, logical analysis, and complex instruction following.

