Token Pricing
On this page
Understanding Grok Model Billing
Grok model pricing follows a simple principle: you pay based on the volume of tokens processed. However, beneath this apparent simplicity lie several mechanisms you need to master to control your costs: input tokens, output tokens, automatic cache, and reasoning tokens.
This lesson gives you a complete view of the pricing table and billing mechanisms.
Complete Pricing Table
Rates per million tokens, for requests with fewer than 200,000 prompt tokens (rates as of November 2, 2026):
| Model | Context | Input | Cached Input | Output |
|---|---|---|---|---|
| grok-4.7 (flagship) | 500k | $2.00 | $0.50 | $6.00 |
| grok-4.6 | 500k | $2.00 | $0.50 | $6.00 |
| grok-4.5 | 500k | $2.00 | $0.30 | $6.00 |
| grok-4.3 (economical) | 1M | $1.25 | $0.20 | $2.50 |
| grok-4.20-0309 (reasoning and non-reasoning) | 1M | $1.25 | $0.20 | $2.50 |
| grok-4.20-multi-agent-0309 | 1M | $1.25 | $0.20 | $2.50 |
| grok-build-0.1 (code) | 256k | $1.00 | $0.20 | $2.00 |
When the prompt reaches 200,000 tokens, the table moves to the higher tier and all three rates double: grok-4.7, for example, goes to $4.00 for input, $1.00 for cache, and $12.00 for output.
The Four Token Types
To understand your bill, you need to distinguish four token categories:
Input Tokens
These are the tokens you send to the model: system prompt, user messages, context, documents. Each non-cached token is billed at the standard input rate.
Cached Tokens
When you send a request that shares a common prefix with a previous request, tokens already processed are retrieved from the cache. These cached tokens receive a steep discount on the input rate: 75% on grok-4.7 ($0.50 instead of $2.00), 85% on grok-4.5 ($0.30), 84% on grok-4.3 and the 4.20 generation ($0.20 instead of $1.25), 80% on grok-build-0.1.
The cache is fully automatic—you don’t need to configure anything. Cached tokens appear in the usage object of the response.
Output Tokens
Tokens generated by the model in its visible response. This is the text you receive and display to the user.
Reasoning Tokens
For reasoning variants only. These tokens represent the model’s internal “thinking.” They are billed at the output rate but do not appear in the visible response. They are tracked separately in usage.completion_tokens_details.reasoning_tokens.
Reading Your Bill in the API Response
Every API response contains a detailed usage object. Here’s how to interpret it:
{
"usage": {
"prompt_tokens": 5000,
"completion_tokens": 800,
"total_tokens": 5800,
"completion_tokens_details": {
"reasoning_tokens": 300
},
"cost_in_usd_ticks": 5000000000
}
}
The cost_in_usd_ticks field gives the exact cost of the request. The unit is the “tick”: 10 billion ticks = 1 USD. In this example, 5,000,000,000 ticks = $0.50.
An alternative field cost_in_nano_usd is also available: 1 billion = 1 dollar.
The Tokenizer
Before sending a request, you can estimate the number of tokens it will consume using two tools:
- Web Console:
console.x.ai/team/default/tokenizer— graphical interface to test your prompts - Tokenization API:
/v1/tokenize-textendpoint — programmatic counting
This is particularly useful for estimating costs before launching batch processing on a large data volume.
Input Image Tokens
If you send images to a multimodal model (Grok 4.5 or the 4.20 generation), each image consumes between 256 and 1,792 tokens depending on its size and the requested detail level. Images must be in JPG or PNG format, with a maximum size of 20 MiB.
These image tokens are billed as standard input tokens.
Key Takeaways
- Four token types: input, cached, output, reasoning
- Automatic cache reduces input rate by 75% (grok-4.7) to 85% (grok-4.5) depending on the model
- Rates double starting at 200,000 prompt tokens
- Reasoning tokens are billed at the output rate
- The
cost_in_usd_ticksfield gives the exact cost (10 billion = $1) - Use the tokenizer to estimate costs before volume processing
- Input images consume 256 to 1,792 tokens depending on size