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.

Modalities
Image, TextText
In / Out price
$1.25/$2.5per 1M
Context window
2M tokens
Released
Apr 9, 2026

Grok 4.20 Reasoning overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by Grok 4.20 Reasoning through AI/ML API

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.

Grok 4.20 Reasoning API pricing

Grok 4.20 Reasoning pricing in US dollars
UsagePriceUnit
Input$1.251M tokens
Output$2.51M tokens
Cached input$0.21M 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.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Grok 4.20 Reasoning$1.25$2.5
Grok Build 0.1$1$2
Grok 4.7$2$6
Grok 4.6$2$6
Grok 4.5$2$6

How to use the Grok 4.20 Reasoning API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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."
    }
  ]
}'

Related articles

All posts

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.

Start building with Grok 4.20 Reasoning

Grok 4.20 Reasoning API

x-ai/grok-4-20-0309-reasoning

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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."
    }
  ]
}'