xAI API pricing
xAI API pricing: Grok 4.7 $2.00 / $6.00 per 1M input / output tokens, plus 1 more current model below. Checked 13 Oct 2026 against xAI pricing.
Cheapest frontier model elsewhere: DeepSeek V4 Pro at $1.32 / $3.96, against $2.00 / $6.00 for Grok 4.7. Compare the two
| Batch | API model ID | ||||||
|---|---|---|---|---|---|---|---|
| $2.00 | $6.00 | $0.50 | 500K | 21 Sep 2026 | — | grok-4.7 |
|
| $1.00 | $2.00 | $0.20 | 256K | 19 May 2026 | — | grok-build-0.1 |
Previous versions still available 3 models
| Model | Input / 1M | Output / 1M | Cached input | Context | Released | Batch | API model ID |
|---|---|---|---|---|---|---|---|
| $2.00 | $6.00 | $0.50 | 500K | 12 Aug 2026 | — | grok-4.6 |
|
| $2.00 | $6.00 | $0.30 | 500K | 8 Jul 2026 | — | grok-4.5 |
|
| $1.25 | $2.50 | $0.20 | 1M | Apr 2026 | 20% off | grok-4.3 |
Recent xAI price changes
All changes- xAI released Grok Build 0.1, a coding model, in early access at $1 / $2 per 1M tokens. (Grok Build 0.1) Source
How xAI prices its API
- Grok 4.5 and later cost twice as much for prompts of 200K tokens or more.
- Batch requests cost 20% less, but only on Grok 4.3 and Grok 4.20.
xAI model IDs
| Model | API model ID | Context | Max output | Released |
|---|---|---|---|---|
| Grok 4.7 | grok-4.7 | 500K | — | 21 Sep 2026 |
| Grok Build 0.1 | grok-build-0.1 | 256K | — | 19 May 2026 |
Compared with other providers
| Tier | xAI | Cheapest elsewhere | xAI costs |
|---|---|---|---|
| Frontier | Grok 4.7$2.00 / $6.00 | DeepSeek V4 Pro$1.32 / $3.96 | 52% more |
Blended price per 1M tokens (3 input : 1 output), current general-purpose models only. Price isn't quality: compare the models on your own tasks. Compare up to four models
xAI model comparisons
Compare up to fourQuestions
How much does the xAI API cost?
xAI API pricing: Grok 4.7 $2 / $6 per 1M input / output tokens, checked 13 Oct 2026. Every model is billed per token, separately for input and output.
What is the cheapest xAI model?
Grok 4.7, at $2 / $6 per 1M input / output tokens.
Does xAI charge less for cached input?
Yes. Repeated input served from cache costs $0.50 per 1M on Grok 4.7, $0.20 per 1M on Grok Build 0.1.
Is there a batch discount?
xAI does not list a batch discount on its pricing page as of 13 Oct 2026.
Do long prompts cost more?
On some models. Grok 4.7 charges $4 / $12 for prompts over 200K tokens; Grok Build 0.1 charges $2 / $4 for prompts over 200K tokens. The higher rate applies to the whole request.
xAI model families
Retired xAI models
- RetiredGrok 4.1 Fast, replaced by Grok 4.7