Grok API Cost Calculator
Calculate your cost
| Part | Rate per 1M | Per request |
|---|---|---|
| Input | $2 | $0.00600 |
| Cached input | $0.5 | $0.00 |
| Output | $6 | $0.00480 |
| Reasoning | $6 | $0.00960 |
Reasoning is 47% of this bill. A lower reasoning effort could cut it.
Add tools, image and video generation
Tools $0.00 + images $0.00 + video $0.00 (image and video are not discounted by Batch or Priority). Grand total $20.40
Grok API text prices (per 1M tokens)
| Model | Context | Input | Cached | Output | Prompt ≥200k (in / cached / out) |
|---|---|---|---|---|---|
| grok-4.7 | 500k | $2 | $0.5 | $6 | $4 / $1 / $12 |
| grok-4.6 | 500k | $2 | $0.5 | $6 | $4 / $1 / $12 |
| grok-4.5 | 500k | $2 | $0.3 | $6 | $4 / $0.6 / $12 |
| grok-4.3 | 1M | $1.25 | $0.2 | $2.5 | $2.5 / $0.4 / $5 |
| grok-4.20-0309-reasoning | 1M | $1.25 | $0.2 | $2.5 | $2.5 / $0.4 / $5 |
| grok-4.20-0309-non-reasoning | 1M | $1.25 | $0.2 | $2.5 | $2.5 / $0.4 / $5 |
| grok-4.20-multi-agent-0309 | 1M | $1.25 | $0.2 | $2.5 | $2.5 / $0.4 / $5 |
Other published rules: the Batch API is 20% off, priority processing costs 2x, the US regional endpoint (grok-4.7 and grok-4.6 only) costs 1.1x, and server-side tools are billed on top of tokens (web search and code execution are $5 per 1,000 calls). Image generation costs $0.02 per image (grok-imagine-image) or $0.04 (grok-imagine-image-2.0); video costs $0.05, $0.08 or $0.02 per second for grok-imagine-video, video-1.5 and video-1.5-lite. Source: docs.grok.com/developers/pricing, checked December 2, 2026.
Related tools
Count tokens first with the Grok token estimator, or get fewer, better requests with the prompt improver. Grok Searcher is not affiliated with xAI.
FAQ
How much does the Grok API cost?
As of December 2, 2026, grok-4.7 costs $2 per 1M input tokens, $0.50 per 1M cached input tokens and $6 per 1M output tokens for prompts under 200k tokens. grok-4.3 and the grok-4.20 models cost $1.25 input, $0.20 cached and $2.50 output. Check xAI’s pricing page for changes.
Are reasoning tokens billed?
Yes. xAI bills reasoning tokens at the same rate as completion (output) tokens. On reasoning-heavy tasks they can be most of the bill, which is why the calculator shows them separately.
What is long-context pricing?
When a request’s prompt, including cached tokens, reaches 200,000 tokens, the higher long-context rates apply to all tokens in that request, not just the part above 200k.
How do I cut Grok API costs?
Reuse a stable prompt prefix so it is served from cache, lower the reasoning effort where quality allows, keep prompts under 200k tokens, and use the Batch API (20% off) for work that does not need an instant answer.
How accurate is this calculator?
It applies xAI’s published rates to the token counts you enter. Real bills depend on actual token counts (inference adds some tokens beyond what the tokenizer shows), server-side tool calls, which are priced separately, and any price changes.