Grok 4 pricing
Grok 4 API cost from xAI (Grok) — $3.00 per 1M input tokens and $15.00 per 1M output tokens. Flagship. Estimate your real monthly bill below, then compare it against every other model.
Flagship 256K context · all prices USD per 1M tokens, list price last verified 2026-06-27.
Grok 4 capabilities & limits
Representative specs for this tier — confirm exact limits in the xAI (Grok) docs.
API acting up? Check live xAI (Grok) status → · all AI API status
Call Grok 4 from your code
The exact model string and endpoint to use. Works with the OpenAI SDK — just point base_url at the URL below.
grok-4https://api.x.ai/v1XAI_API_KEYcurl https://api.x.ai/v1/chat/completions \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4",
"messages": [{"role": "user", "content": "Hello"}]
}' Model strings follow each provider's naming convention; confirm the current id in the xAI (Grok) docs before relying on it.
What a Grok 4 API call actually costs
Blended input + output cost at Grok 4's list rates — useful yardsticks before you commit to volume.
Grok 4 cost calculator
Enter your monthly volume to estimate the Grok 4 bill. Runs entirely in your browser.
xAI (Grok) models — Grok 4 in context
How Grok 4 prices against its siblings. Cheapest reference cost first.
| Model | Input /1M | Output /1M | Cost / call* | Context | Type |
|---|---|---|---|---|---|
| Grok 3 mini | $0.100 | $0.300 | $0.0004 | 128K | Fast / cheap |
| Grok 4 Fast 2M context | $0.200 | $0.500 | $0.0007 | 2M | Fast / cheap |
| Grok Code Fast 1 Code-specialised | $0.200 | $1.50 | $0.0017 | 256K | Balanced |
| Grok 4 Flagship | $3.00 | $15.00 | $0.018 | 256K | Flagship |
*Reference cost of one call with 1,000 input + 1,000 output tokens — a neutral yardstick. Use the calculator for your real usage. Cheapest row highlighted.
How Grok 4 pricing works
Grok 4 is billed per token: a lower input price of $3.00 per million tokens for everything you send, and a higher output price of $15.00 per million for everything the model generates. To turn that into a real Grok 4 bill, multiply by your monthly request volume and average prompt/response length — the calculator above does exactly that.
Grok 4 does not list a separate cached-input rate, so every input token bills at $3.00 per million. If repeated context is a big part of your prompts, a model with prompt caching may end up cheaper in practice.
List prices move fast — always confirm the current numbers on the official xAI (Grok) pricing page before relying on them for budgeting.
Grok 4 pricing FAQ
How much does the Grok 4 API cost?
Grok 4 costs $3.00 per 1M input tokens and $15.00 per 1M output tokens. A typical 3K-input / 500-output call works out to about $0.017.
What is Grok 4's context window?
Grok 4 has a 256K-token context window. Tokens you put in the prompt are billed at the $3.00 per 1M input rate.
Does Grok 4 charge extra for output tokens?
Yes. Output (generated) tokens cost $15.00 per 1M, versus $3.00 per 1M for input — about 5.0× more, which is normal for LLM APIs.
Is there a cheaper alternative to Grok 4?
In the same flagship tier, MiniMax-M3 (MiniMax) is cheaper at $0.300 in / $1.20 out. The overall cheapest model on the market is Gemini 1.5 Flash-8B.