Grok 4 Fast Reasoning API

x-ai/grok-4-fast-reasoning
Grok 4 Fast Reasoning combines fast inference with advanced multi-step reasoning capabilities, enabling deep understanding and processing of extensive documents.
Context
2M tokens
Input
$1.625 / 1M tokens
Output
$3.25 / 1M tokens
Released
Sep 30, 2025

Overview

Grok 4 Fast Reasoning is an advanced variant of xAI’s Grok 4 model, optimized for ultra-fast reasoning and extensive context handling. It supports a massive 2,000,000 token context window, enabling sophisticated long-horizon text understanding and multi-step inference with high efficiency. This version balances speed and reasoning depth, making it ideal for large-scale, real-time applications.

Technical Specification

Performance Benchmarks

  • Context Window: 2,000,000 tokens
  • Max Output: ~4,096 tokens
  • Training Regime: Enhanced for fast inference with optimized compute pathways
  • Tool Use: Integrated native support with streamlined multi-step execution

Performance Metrics

  • Superior performance in long-context tasks requiring rapid comprehension
  • High accuracy in complex text-to-text scenarios with intricate dependencies

Key Capabilities

  • Ultra-long context understanding up to 2 million tokens for deep document comprehension
  • Accelerated reasoning providing faster turnaround on multi-step tasks
  • Deterministic outputs optimized for stable responses over very large input sizes

API Pricing

  • Input: 0–128k: $0.26; 128k+: $0.52 1M tokens
  • Output: 0–128k: $0.65; 128k+: $1.3 per 1M tokens

Optimal Use Cases

  • Large-scale document analysis and synthesis where extended context is crucial
  • Real-time autonomous agents requiring fast, reliable multi-step reasoning
  • Complex strategic planning involving API orchestration and extended logic chains
  • Advanced research evaluation for datasets with vast textual dependencies
  • Text-to-text transformations including summarization, Q&A, and content generation across extensive inputs

Code Sample

Comparison with Other Models

  • vs. GPT-4o: Grok 4 Fast Reasoning supports a vastly larger context window of 2 million tokens compared to GPT-4o, enabling deeper long-form understanding. While GPT-4o excels in multimodal inputs and web browsing, Grok 4 Fast offers faster inference and superior reasoning over extended texts.
  • vs. Claude 4 Opus: Claude 4 Opus is known for exceptional language safety and alignment features. Grok 4 Fast outperforms Claude 4 in handling ultra-long context tasks and delivers higher throughput in multi-step reasoning scenarios.
  • vs. Gemini 2.5 Pro: Gemini 2.5 Pro provides strong instruction following and speed for typical text tasks. Grok 4 Fast surpasses Gemini in zero-shot reasoning with very long inputs, leveraging its 2 million token context for complex planning and inference.
  • vs. Grok 4: Grok 4 Fast Reasoning builds on Grok 4 by dramatically increasing the context window from 256K to 2 million tokens, supporting larger and more complex documents. It also features optimized compute pathways for faster execution while maintaining advanced tool integration and reasoning capabilities.

Limitations

  • Text-only model without vision or audio modalities
  • Tool use remains sequential, limited compositionality
  • Closed-weight approach with no offline or local inference support
  • Stream determinism may vary under certain high-throughput conditions

Uptime and performance

  • Uptime (24h): 100%
  • Uptime (7d): 100%
  • Availability (24h): 100%
  • Error rate (24h): 0%

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

Use cases

  • Large-scale document analysis and synthesis where extended context is crucial
  • Real-time autonomous agents requiring fast, reliable multi-step reasoning
  • Complex strategic planning involving API orchestration and extended logic chains
  • Advanced research evaluation for datasets with vast textual dependencies
  • Text-to-text transformations including summarization, Q&A, and content generation across extensive inputs

‍

How to use Grok 4 Fast Reasoning API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to x-ai/grok-4-fast-reasoning.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "x-ai/grok-4-fast-reasoning",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = 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-fast-reasoning",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"x-ai/grok-4-fast-reasoning","messages":[{"role":"user","content":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Grok 4 Fast Reasoning API Pricing

TypePrice
Input
$1.625 / 1M tokens
Output
$3.25 / 1M tokens
Cached input
$0.26 / 1M tokens

Grok 4 Fast Reasoning Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
AIME 2025
92%
Competition mathematics (AIME), 2025SourceJuly 8, 2026
GPQA Diamond
85.7%
Google-proof graduate science questions (hardest subset)SourceJuly 8, 2026
Intelligence
17.9
Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026
Math
89.7
Composite score across standardised mathematics evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026

Grok 4 Fast Reasoning vs other models

ModelInputOutputContextBest for
$1.625 / 1M tokens
$3.25 / 1M tokens
2M tokens
Coding + agents
$6.5 / 1M tokens
$39 / 1M tokens
1M tokens
Reasoning + agents
$2.6 / 1M tokens
$13 / 1M tokens
1M tokens
Balanced coding + agents
$3.9 / 1M tokens
$19.5 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$1.95 / 1M tokens
$11.7 / 1M tokens
1M tokens
Reasoning + agents

Frequently asked questions

Grok 4 Fast Reasoning has a 2,000,000 tokens context window and can return up to 1,999,000 tokens.

Grok 4 Fast Reasoning takes image, text as input and returns text.

Use x-ai/grok-4-fast-reasoning as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

Grok 4 Fast Reasoning is priced at input $1.625 / 1M tokens, output $3.25 / 1M tokens, cached input $0.26 / 1M tokens.

Yes, Grok 4 Fast Reasoning can stream responses as they are generated.

Yes, Grok 4 Fast Reasoning accepts image input alongside text.

Grok 4 Fast Reasoning was built by xAI .

No. Grok 4 Fast Reasoning runs with reasoning always active as part of its design.

Yes, it supports function calling, tool use, and parallel tool calls.

Start building with Grok 4 Fast Reasoning

Get API Key
1000+ models, one API.