Complete pricing breakdown for all 10 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.
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.
| Model | Input $/1M | Output $/1M |
|---|---|---|
| Grok 4.1 Fast | $0.200 | $0.500 |
| Grok 4 Fast | $0.200 | $0.500 |
| Grok 3 Mini | $0.300 | $0.500 |
| Grok 3 Mini Beta | $0.300 | $0.500 |
| Grok Code Fast 1 | $0.200 | $1.50 |
| Grok 4.20 Multi-Agent Beta | $2.00 | $6.00 |
| Grok 4.20 Beta | $2.00 | $6.00 |
| Grok 4 | $3.00 | $15.00 |
| Grok 3 | $3.00 | $15.00 |
| Grok 3 Beta | $3.00 | $15.00 |
| Model | Input $/1M | Output $/1M |
|---|---|---|
| Grok 4.1 Fast | $0.200 | $0.500 |
| Grok 4 Fast | $0.200 | $0.500 |
| Grok 3 Mini | $0.300 | $0.500 |
| Grok 3 Mini Beta | $0.300 | $0.500 |
| Model | Input $/1M | Output $/1M |
|---|---|---|
| Grok Code Fast 1 | $0.200 | $1.50 |
| Model | Input $/1M | Output $/1M |
|---|---|---|
| Grok 4.20 Multi-Agent Beta | $2.00 | $6.00 |
| Grok 4.20 Beta | $2.00 | $6.00 |
| Model | Input $/1M | Output $/1M |
|---|---|---|
| Grok 4 | $3.00 | $15.00 |
| Grok 3 | $3.00 | $15.00 |
| Grok 3 Beta | $3.00 | $15.00 |
See how xAI Grok API pricing stacks up against OpenAI (GPT) and Anthropic (Claude) models. All prices in USD per million tokens.
| Model | In | Out |
|---|---|---|
| Grok 4.1 Fast | $0.200 | $0.500 |
| Grok 4 Fast | $0.200 | $0.500 |
| Grok 3 Mini | $0.300 | $0.500 |
| Grok 3 Mini Beta | $0.300 | $0.500 |
| Grok Code Fast 1 | $0.200 | $1.50 |
| Grok 4.20 Multi-Agent Beta | $2.00 | $6.00 |
| Grok 4.20 Beta | $2.00 | $6.00 |
| Grok 4 | $3.00 | $15.00 |
| Model | In | Out |
|---|---|---|
| gpt-oss-120b (free) | Free | Free |
| gpt-oss-20b (free) | Free | Free |
| Sora | Free | Free |
| gpt-oss-20b | $0.030 | $0.140 |
| gpt-oss-120b | $0.039 | $0.190 |
| gpt-oss-safeguard-20b | $0.075 | $0.300 |
| GPT-5 Nano | $0.050 | $0.400 |
| GPT-4.1 Nano | $0.100 | $0.400 |
| Model | In | Out |
|---|---|---|
| Claude 3 Haiku | $0.250 | $1.25 |
| Claude 3.5 Haiku | $0.800 | $4.00 |
| Claude Haiku 4.5 | $1.00 | $5.00 |
| Claude Sonnet 4.6 | $3.00 | $15.00 |
| Claude Sonnet 4.5 | $3.00 | $15.00 |
| Claude Sonnet 4 | $3.00 | $15.00 |
| Claude 3.7 Sonnet | $3.00 | $15.00 |
| Claude 3.7 Sonnet (thinking) | $3.00 | $15.00 |
Estimated daily and monthly costs for common usage patterns. Assumes an average of ~1,000 input tokens and ~500 output tokens per request.
| Model | $/1M In | $/1M Out |
|---|---|---|
| Grok 4.1 Fast | $0.200 | $0.500 |
| Grok 3 Mini | $0.300 | $0.500 |
| Grok 4.20 Multi-Agent Beta | $2.00 | $6.00 |
| Grok 4 | $3.00 | $15.00 |
| Grok 3 Beta | $3.00 | $15.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.
xAI charges per token, not per request. A token is roughly 3/4 of a word. The sentence "Hello, how are you?" is about 6 tokens. Prices are quoted per million tokens. Input tokens (your prompts) are cheaper than output tokens (the model's response) because output generation requires more computation.
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.
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.
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.
Compare with GPT-4o, o3, and all OpenAI model costs.
Compare with Claude Opus 4, Sonnet 4, and all Anthropic models.
Compare with Gemini 2.5 Pro, Flash, and all Google models.
Find the most affordable models across all providers.
Grok 3 pricing is $3.00/1M input tokens and $15.00/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 3 Mini Beta at $0.300/1M input and $0.500/1M output tokens. It offers a 131K context window and supports function calling, JSON mode, and streaming.
xAI and OpenAI target different price segments. Grok's average output price is $6.05/1M tokens across 10 paid models. OpenAI offers 62 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.