Skip to content

xAI Grok API Pricing

Last updated: 11m ago

Complete pricing breakdown for all 5 xAI Grok API models. Compare input and output costs per million tokens for Grok 3, Grok 4, Grok Mini, and every other Grok variant. Includes a cost calculator and side-by-side comparison with OpenAI and Anthropic. Updated hourly from live API data.

What is xAI Grok?

xAI is Elon Musk's artificial intelligence company, founded in 2023 to build AI systems that advance scientific understanding. Their flagship product line is Grok -- a family of large language models available through the xAI API and integrated into the X (formerly Twitter) platform.

Grok models are known for their large context windows (up to 2M tokens), competitive pricing, and strong performance on reasoning and coding benchmarks. The lineup ranges from the cost-efficient Grok Mini and Grok Fast variants for high-throughput workloads, to the premium Grok 3 and Grok 4 models for advanced reasoning, code generation, and multi-agent tasks.

$2.00
Cheapest ($/1M out)
Grok Build 0.1
$6.00
Most Expensive ($/1M out)
Grok 4.5
0
Free Models
$3.10
Avg Output $/1M

Grok Model Pricing -- All Models

5 models sorted by output price
ModelInput $/1MOutput $/1M
Grok Build 0.1$1.00$2.00
Grok 4.3$1.25$2.50
Grok 4.20 Multi-Agent$1.25$2.50
Grok 4.20$1.25$2.50
Grok 4.5$2.00$6.00

Grok Pricing by Tier

$1 -- $5

$1.00 -- $4.99 -- 4 models
ModelInput $/1MOutput $/1M
Grok Build 0.1$1.00$2.00
Grok 4.3$1.25$2.50
Grok 4.20 Multi-Agent$1.25$2.50
Grok 4.20$1.25$2.50

$5 -- $15

$5.00 -- $14.99 -- 1 model
ModelInput $/1MOutput $/1M
Grok 4.5$2.00$6.00

Grok vs OpenAI vs Anthropic -- Pricing Comparison

See how xAI Grok API pricing stacks up against OpenAI (GPT) and Anthropic (Claude) models. All prices in USD per million tokens.

xAI Grok

5 models
ModelInOut
Grok Build 0.1$1.00$2.00
Grok 4.3$1.25$2.50
Grok 4.20 Multi-Agent$1.25$2.50
Grok 4.20$1.25$2.50
Grok 4.5$2.00$6.00

OpenAI

97 models
ModelInOut
gpt-oss-20b (free)FreeFree
SoraFreeFree
gpt-oss-20b$0.030$0.130
gpt-oss-120b$0.037$0.170
GPT-5 Nano (batch)$0.025$0.200
GPT-4.1 Nano (batch)$0.050$0.200
gpt-oss-safeguard-20b$0.075$0.300
GPT-4o-mini (batch)$0.075$0.300

Anthropic

28 models

Grok API Cost Calculator

Grok API cost estimates across usage tiers. Based on ~1,000 input tokens and ~500 output tokens per request. Pricing varies significantly between Grok Mini and flagship models.

Model$/1M In$/1M Out
Grok Build 0.1$1.00$2.00
Grok 4.3$1.25$2.50
Grok 4.20 Multi-Agent$1.25$2.50
Grok 4.20$1.25$2.50
Grok 4.5$2.00$6.00

Note: Actual costs vary with prompt length, response length, and batch processing. xAI offers competitive pricing and volume-based discounts for enterprise customers. Try the interactive calculator for custom estimates.

Understanding xAI Grok API Pricing

Token-Based Billing

xAI bills Grok API usage per token, following the industry standard of quoting prices per million tokens. Input tokens (your prompts) cost less than output tokens (Grok's responses). The Grok family spans a wide price range - from the affordable Grok 3 Mini for lightweight tasks to Grok 4 for complex reasoning that justifies its premium pricing.

Grok 3 vs Grok 4 vs Grok Fast

Grok 3 is the proven workhorse for complex reasoning and coding at $3/$15 per million input/output tokens. Grok 4 represents the cutting edge with larger context windows. Grok Fast variants (Grok 4 Fast, Grok 4.1 Fast) offer the lowest latency and best value at just $0.20/$0.50 per million tokens, ideal for high-throughput production workloads.

Massive Context Windows

Grok models lead the industry with up to 2M token context windows on the latest Grok 4 and Grok 4.1 variants. This means you can process entire codebases, long documents, or extended conversation histories in a single request without chunking or summarization. Grok 3 offers a solid 128K context window.

Saving on API Costs

Start with Grok 4 Fast or Grok 3 Mini for simple tasks and only upgrade to Grok 3 or Grok 4 when the task demands advanced reasoning. Use shorter prompts and set appropriate max_tokens limits to control output costs. For high-volume workloads, consider the Fast model variants which offer 10x or more savings over the premium models.

xAI Grok API Pricing FAQ

Grok 3 pricing is Free/1M input tokens and Free/1M output tokens. Grok 3 is xAI's flagship reasoning model with a 131K context window, designed for complex tasks, math, and coding.

xAI offers 0 free models via their API. For paid models, xAI provides competitive pricing across tiers -- from the budget-friendly Grok Mini variants for simple tasks to the premium Grok 3 and Grok 4 models for advanced reasoning. Free access to Grok is also available through the X (formerly Twitter) platform for basic usage.

The cheapest paid Grok model is Grok Build 0.1 at $1.00/1M input and $2.00/1M output tokens. It offers a 256K context window and supports function calling, JSON mode, and streaming.

xAI and OpenAI target different price segments. Grok's average output price is $3.10/1M tokens across 5 paid models. OpenAI offers 97 models with varying price points. The Grok Fast models are competitively priced against GPT-4o Mini, while Grok 3 and Grok 4 compete with GPT-4o and o3 at similar or lower price points. See the comparison table above for a detailed breakdown.

Grok models offer industry-leading context windows. The latest Grok 4 and Grok 4.1 Fast models support up to 2M (2 million) tokens of context, making them ideal for processing very long documents, codebases, and multi-turn conversations. Grok 3 models offer 128K context windows. All Grok models support streaming, function calling, and JSON mode.

xAI Grok API Pricing — Grok 3 & Grok 2 Costs (2026) | LM Market Cap