grok-4.7 is the model xAI recommends for code and chat. It has a 500k-token context and costs $2.00 per million input tokens and $6.00 per million output tokens for requests under 200k prompt tokens.
The price doubles once a request reaches 200k prompt tokens. This guide covers the API, not the Grok app on X.
The short answer
- Recommended model: grok-4.7, per xAI’s models and pricing page as read on 22 October 2026.
- Price under 200k prompt tokens: $2.00 input and $6.00 output per million tokens.
- Price at 200k or more: $4.00 input and $12.00 output, and it applies to every token in that request.
- Other models: grok-4.6, grok-4.5, grok-4.3, grok-4.20 and grok-build-0.1 are priced in the table below.
- Prices change, so confirm on the page before you budget.
What do the Grok text models cost per 1M tokens?
Each cell shows the price under 200k prompt tokens, then the price at 200k or more.
| Model | Context | Input (<200k / ≥200k) | Cached input (<200k / ≥200k) | Output (<200k / ≥200k) |
|---|---|---|---|---|
| grok-4.7 | 500k | $2.00 / $4.00 | $0.50 / $1.00 | $6.00 / $12.00 |
| grok-4.6 | 500k | $2.00 / $4.00 | $0.50 / $1.00 | $6.00 / $12.00 |
| grok-4.5 | 500k | $2.00 / $4.00 | $0.30 / $0.60 | $6.00 / $12.00 |
| grok-4.3 | 1M | $1.25 / $2.50 | $0.20 / $0.40 | $2.50 / $5.00 |
| grok-4.20 (reasoning, non-reasoning, multi-agent) | 1M | $1.25 / $2.50 | $0.20 / $0.40 | $2.50 / $5.00 |
| grok-build-0.1 | 256k | $1.00 / $2.00 | $0.20 / $0.40 | $2.00 / $4.00 |
For models with two rows, a request with at least 200k prompt tokens is billed at the higher rate for all tokens in that request.
Which model is cheapest for what?
Three comparisons follow from the table. They are our arithmetic on xAI’s listed prices.
- grok-4.3 against grok-4.7 on output: $2.50 against $6.00 per million under 200k, so grok-4.7 costs 2.4 times as much per output token.
- Worked example: a request with 100,000 input tokens and 5,000 output tokens on grok-4.7 costs $0.20 for input plus $0.03 for output, $0.23 in total, with no cached tokens.
- The 200k cliff: the same request with 200,000 input tokens costs $0.80 for input, not $0.40, because the higher rate covers every token.
The practical lesson is to keep prompts under 200k tokens where you can. We suggest trimming or splitting long inputs before sending them.
What do images, video and voice cost?
- Images: grok-imagine-image-quality $0.05 per image, grok-imagine-image-2.0 $0.04, grok-imagine-image $0.02.
- Video: grok-imagine-video-1.5-lite $0.020 per second, grok-imagine-video-1.5 $0.080, grok-imagine-video $0.050.
- Voice: speech-to-speech with grok-voice-3.0 at $0.08 per minute. Speech-to-text is $0.10 per hour (REST) or $0.20 (streaming). Text-to-speech is $15.00 per 1M characters.
What limits should you know before building?
- Grok has no knowledge of current events beyond its training data unless server-side Web Search or X Search is enabled.
- The knowledge cutoff for grok-4.7 is May 2026.
- Image input is limited to 20 MiB per image, in JPG, JPEG or PNG.
- logprobs and top_logprobs are unsupported on grok-4.20 and newer and are silently ignored.
- Aliases: <modelname> points to the latest stable version, -latest to the newest, and -<date> to a fixed release.
The pages do not show whether tools such as Web Search carry extra fees, so check before estimating cost.
Who should pick which model?
- Pick grok-4.7 when you want xAI’s recommended model for code and chat and your prompts stay under 200k tokens.
- Consider grok-4.3 or grok-4.20 when you need the 1M context or lower per-token prices.
- Consider grok-build-0.1 for the lowest listed text prices, with a 256k context.
Questions and answers about the Grok API
Which Grok model does xAI recommend for code?
grok-4.7, per the page’s recommended models list.
How much does grok-4.7 cost?
$2.00 per million input tokens and $6.00 per million output tokens under 200k prompt tokens.
What changes at 200k prompt tokens?
The rate rises, for example to $4.00 input and $12.00 output for grok-4.7, and it applies to all tokens in the request.
Which Grok model has the largest context?
grok-4.3 and grok-4.20 list 1M tokens. grok-4.7, grok-4.6 and grok-4.5 list 500k, and grok-build-0.1 lists 256k.
Does cached input cost less?
Yes. For grok-4.7, cached input is $0.50 per million under 200k tokens, against $2.00 for fresh input.
Sources
Facts read on 22 October 2026.
Part of the guide: AI Model Pricing and API Cost Guides



