Grok 4.20 API

Whether you're building analytical tools, AI copilots, or conversational applications, Grok 4.20 offers two specialized modes, Grok 4.20 Reasoning and Grok 4.20 Non-Reasoning, allowing you to tailor intelligence to your specific use case.

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

Grok 4.20 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 through AI/ML API

Grok 4.20 by xAI

Designed for flexibility and real-world deployment, Grok 4.20 bridges the gap between cognitive tasks that require logic and reasoning, and high-throughput, production-ready text generation.

Grok 4.20 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
Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

What Is Grok 4.20 API?

Grok 4.20 is a dual-mode large language model system that separates deep reasoning intelligence from optimized text generation performance. This separation lets you optimize for accuracy versus speed, cost versus intelligence, and complexity versus throughput without switching platforms. Developers and businesses can use Grok 4.20 to create applications that require structured logical thinking as well as conversational and content-driven AI at scale.

Technical Specifications

Understanding the constraints of the Grok 4.20 API is vital for preventing runtime errors and maximizing context utilization.

  • Context Window: 2,000,000 tokens (Approx. 3,000 A4 pages).
  • Input Modality: Text and Image (Vision-capable).
  • Output Modality: Text only (No native image generation).

The 2M Context Window Advantage

One of the standout features of Grok 4.20 is its massive 2 million token context window. To put that in perspective, that's roughly the equivalent of 3,000 pages of standard A4 text.

  • What this means for developers: You can dump entire code repositories (including the node_modules folder, though we don't recommend it) into the prompt for refactoring. You can pass in multi-hour meeting transcripts or complete quarterly financial histories.
  • Impact on RAG: While Retrieval-Augmented Generation is still best practice for infinite knowledge stores, the 2M window drastically reduces the need for complex chunking and reranking. You can perform "Needle in a Haystack" analysis with far greater fidelity, reducing the chance that the model misses a critical reference buried deep in the context.

Grok 4.20 Reasoning

Grok 4.20 Reasoning is optimized to think before it responds, producing outputs that are accurate, coherent, and explainable even in demanding analytical scenarios. This makes it ideal for AI research assistants, engineering problem-solving, legal analysis, and data-intensive workflows where correctness is critical.

The model can handle layered instructions and maintain logical consistency across long outputs, producing detailed explanations, step-by-step reasoning, and structured analytical results. It is especially effective in domains where nuanced reasoning and careful analysis are essential, from technical reports to decision-support systems.

When to Use Grok 4.20 Reasoning

Primary Benefit: Superior accuracy on complex, ambiguous, or high-stakes tasks.

  • Scientific Research & Data Analysis: The 49 Intelligence Index score shines when parsing dense research papers or modeling complex systems.
  • Advanced Code Generation & Debugging: Solving intricate algorithmic puzzles or refactoring legacy code with unknown dependencies.
  • Strategic Planning & Logical Puzzles: Any scenario requiring "Step-back" questioning and multi-variable logical deduction.

Grok 4.20 Non-Reasoning

Grok 4.20 Non-Reasoning is a general-purpose language model optimized for conversational fluency, speed, and scalable text generation. It is ideal for applications where response time, volume, and human-like interaction matter more than multi-step reasoning. Non-Reasoning is perfect for customer support chatbots, content automation, social media management, and other high-throughput AI systems.

This model produces outputs with natural conversational flow and strong contextual understanding.

Use cases

Grok 4.20 is documented for complex logic and math, scientific/technical analysis, multi-step investigations, and higher-stakes tasks where accuracy matters more than lowest latency.

It is also documented for routine Q&A, general information retrieval, and high-throughput scenarios where response speed is the priority.

The model is described as suitable for document understanding tasks and long-horizon agentic tool calling.

It is also documented for latency-sensitive use cases like customer support and categorization.

Capabilities

  • Function calling
  • Streaming
  • Reasoning

Grok 4.20 benchmarks by Artificial Analysis

See how Grok 4.20 scores on independent evaluations. Data retrieved Nov 3, 2026.

Benchmark results

Compare 10 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

Grok 4.20 API pricing

Grok 4.20 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 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$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 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."
    }
  ]
}'

Grok 4.20 FAQ

How much does Grok 4.20 cost?

Grok 4.20 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 support streaming?

Yes, Grok 4.20 can stream responses as they are generated.

Does Grok 4.20 support tool calling and structured outputs?

Yes, Grok 4.20 supports function calling.

Who created Grok 4.20?

Grok 4.20 was built by xAI .

Does Grok 4.20 support advanced reasoning?

Yes, reasoning is listed as one of its core capabilities.

What is the Grok 4.20 model ID?

Use x-ai/grok-4-20-0309-reasoning as the model parameter. Requests go to the OpenAI-compatible endpoint with your AI/ML API key.

What is the context window of Grok 4.20?

Grok 4.20 accepts up to 2,000,000 tokens of context and returns up to 1,999,000 output tokens.

Start building with Grok 4.20

Grok 4.20 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."
    }
  ]
}'