Grok API pricing: token, tool and media rates in one place
Every published rate for Grok models on the API, plus the discounts, surcharges and long-context rules that change what you actually pay.
grok-4.7 and grok-4.6 cost $2 input, $0.50 cached and $6 output per 1M tokens. grok-4.3 costs $1.25/$2.50 with a 1M window, and grok-build-0.1 is cheapest at $1/$2. Prompts of 200k tokens or more are billed at double rates. Batch saves 20% on grok-4.3 and grok-4.20 only.
Text model prices
SpaceXSI (formerly xAI) prices text models per 1M tokens, with separate rates for fresh input, cached input and output. Long-context rates apply once a prompt reaches 200k tokens.
| Model | Context | Input | Cached input | Output | Long context (in / cached / out) |
|---|---|---|---|---|---|
| grok-4.7 | 500k | $2.00 | $0.50 | $6.00 | $4.00 / $1.00 / $12.00 |
| grok-4.6 | 500k | $2.00 | $0.50 | $6.00 | $4.00 / $1.00 / $12.00 |
| grok-4.5 | 500k | $2.00 | $0.30 | $6.00 | $4.00 / $0.60 / $12.00 |
| grok-4.3 | 1M | $1.25 | $0.20 | $2.50 | $2.50 / $0.40 / $5.00 |
| grok-4.20-0309 (reasoning, non-reasoning, multi-agent) | 1M | $1.25 | $0.20 | $2.50 | $2.50 / $0.40 / $5.00 |
| grok-build-0.1 | 256k | $1.00 | $0.20 | $2.00 | $2.00 / $0.40 / $4.00 |
The cheapest current text model is grok-build-0.1, built for coding. For general work, grok-4.3 and the grok-4.20 models cost less than half the flagship’s output rate and offer a 1M-token window. Grok 4.7 Fast is not sold on the public API.
How long-context and caching charges work
Two rules shape most bills.
- The 200k threshold covers the whole request. Once a prompt reaches 200k tokens, the long-context rate applies to every token in that request, not just the part above 200k.
- Cached input is much cheaper. On grok-4.7, cached input costs $0.50 instead of $2.00. SpaceXSI strongly recommends setting prompt_cache_key or the x-grok-conv-id header. Without it, a request can hit a cache-cold server and pay the full input price.
Two worked examples on grok-4.7
A request with 100k input tokens and 10k output tokens costs about $0.20 for input plus $0.06 for output, or $0.26.
A request with 250k input tokens and 5k output tokens crosses the threshold. It costs about $1.00 for input plus $0.06 for output, or $1.06. These figures assume no cached tokens.
Output volume matters too. Artificial Analysis measured Grok 4.7 using about 81k output tokens per task in its tests, versus 38k for Grok 4.6. Reasoning tokens count toward your bill.
One more charge: requests flagged for usage violations before generation cost $0.05 each.
Batch, priority and US endpoint
| Option | Effect on price | Applies to |
|---|---|---|
| Batch API | 20% off input, output, cached and reasoning tokens | grok-4.3 and the three grok-4.20-0309 models only |
| Priority processing (service_tier) | 2x standard rates | Text models; not image, video or batch |
| US endpoint (us.api.x.ai) | 1.1x global rates | grok-4.7 and grok-4.6 only |
Batch calls also do not count toward rate limits. Images and video sent through batch are billed at standard rates.
On the US endpoint, grok-4.7 costs $2.20 input, $0.55 cached and $6.60 output, or $4.40, $1.10 and $13.20 above 200k tokens.
Tool call prices
Built-in tools are charged on top of the tokens the model uses.
| Tool | Price |
|---|---|
| Web Search (Image Search billed the same) | $5 per 1,000 calls |
| X Search | $5 per 1,000 posts, $10 per 1,000 profiles |
| Code Execution | $5 per 1,000 calls |
| File attachment search | $5 per 1,000 calls |
| Collections Search (RAG) | $2.50 per 1,000 calls |
| view_image, view_x_video, Remote MCP | Tokens only |
X Search is billed per item returned, and that includes parent and quoted posts. A search that pulls in long threads can cost more than the number of results suggests.
Image, video and voice prices
| Model | Price |
|---|---|
| grok-imagine-image-2.0 | $0.04 to $0.08 per image |
| grok-imagine-image | $0.02 per image |
| grok-imagine-image-quality (retires Nov 2, 2026) | $0.05 to $0.07 per image |
| grok-imagine-video-1.5 | $0.08 (480p), $0.14 (720p), $0.25 (1080p) per second |
| grok-imagine-video-1.5-lite | $0.02 (480p), $0.03 (720p), $0.14 (1080p) per second |
| grok-imagine-video | $0.05 (480p), $0.07 (720p) per second |
| grok-voice-3.0 (speech to speech) | $0.08 per minute ($4.80 per hour) |
| Speech to text | $0.10 per hour (REST), $0.20 per hour (streaming) |
| Text to speech | $15 per 1M characters |
Parts of the voice table were garbled on SpaceXSI’s page when we checked, and VentureBeat reported a lower text-to-speech price in May. Confirm voice rates in your console. More on the models: Grok Imagine and the Grok Voice API.
Storage and billing basics
- Files: $0.025 per GiB per day.
- Collections: $0.10 per GiB per day.
- Downloads: $0.20 per GiB.
Billing is prepaid by default, and requests stop when credits run out. Auto top-up has a $5 minimum, and invoiced billing must be requested from sales. Official pages list no free signup credits. For the consumer side, see Is Grok free?, and for setup steps, see the Grok API overview.
Questions people ask
How much does the Grok API cost per million tokens?
It depends on the model. grok-4.7 costs $2 per 1M input tokens and $6 per 1M output tokens. grok-4.3 costs $1.25 and $2.50. Long prompts of 200k tokens or more cost double.
Does the Grok API have a batch discount?
Yes, 20% off, but only for grok-4.3 and the three grok-4.20-0309 models. Batch calls also do not count toward rate limits.
Is Grok API usage included in the X Subscription?
The x.ai pricing page lists Grok API access under the Plus plan but also says API usage is billed separately. SpaceXSI does not explain how the two interact, so budget for console credits.
Why did my Grok API bill come in higher than expected?
Common causes are crossing the 200k long-context threshold, missing cache hits when no prompt_cache_key is set, many reasoning tokens, and X Search billing per item returned, including quoted posts.
- SpaceXSI Docs: Pricing (fetched Oct 18, 2026)
- SpaceXSI Docs: Grok 4.7 (fetched Oct 18, 2026)
- SpaceXSI Docs: Release notes (fetched Oct 18, 2026)
- SpaceXSI Docs: Billing (fetched Oct 18, 2026)
- x.ai: X Subscription pricing (fetched Oct 18, 2026)
- Artificial Analysis: Benchmarking Grok 4.7 (Sep 21, 2026)
- VentureBeat: Grok 4.3 launch pricing (May 1, 2026)