Four Token Types
On this page
Understand token billing
A Grok API bill isn’t simply volume times price. Four token types coexist, each with its own counting rules and rate, and two apps consuming the same total tokens can pay very different amounts. Reading this breakdown is essential to estimate a budget before launch—and to understand, once in production, where a runaway line item comes from.
Text tokens and the input-output gap
Text tokens make up the bulk of the volume: everything you send—system prompt, conversation history, user message—and everything the model produces in return. On grok-4.5, input is billed at $2.00 per million tokens and output at $6.00 per million. On grok-4.3, these values drop to $1.25 and $2.50 per million.
Remember the shape of the ratio: output consistently costs more than input, by a factor of three on grok-4.5. Generating text requires more compute than reading context, and the pricing grid reflects this asymmetry. The practical consequence is counterintuitive: adding a thousand tokens of examples to your system prompt often costs less than letting the model produce a thousand tokens of superfluous verbiage. A well-placed concision instruction is sometimes the best cost-saving lever in an entire application.
Image tokens
An image sent to the API is converted into tokens before analysis. The count varies from 256 tokens for a low-resolution thumbnail to 1,792 tokens for a high-definition image, depending on size and detail level. These tokens are billed at the text input rate, which makes the trade-off easy to frame: each heavy image equals, on your bill, about fifteen hundred words of prompt.
So build this reflex into the pipeline upstream of the call. Systematically resize to the minimum resolution your use case requires, apply reasonable JPEG compression, and stop sending 4K when a standard image suffices to answer the question. On a service processing thousands of photos per day, this simple resizing cuts the visual bill without degrading response quality. Note the format constraints along the way: only JPG and PNG are accepted, up to 20 MiB per file.
Cached tokens
Cached tokens are input tokens that the API’s automatic cache system already memorized during a previous call. They are billed at a heavily reduced rate: $0.30 per million on grok-4.5 instead of $2.00, about 85% savings, and $0.20 per million on grok-4.3 instead of $1.25.
The mechanism that triggers this caching will be covered in the next section of the course. For now, just know where to read it: the cached_tokens field in the usage object returned with each response tells you how many of your input tokens benefited from the reduced rate. This is the first metric to instrument if you want to manage your costs seriously.
Reasoning tokens
The fourth type concerns models that think before answering, like the grok-4.20-0309-reasoning variant. Reasoning tokens correspond to this internal deliberation, produced before the visible response.
This is where the most frequent billing surprise hides: these tokens are counted at the output rate, not input. On grok-4.5, that represents $6.00 per million. Since reasoning can mobilize several thousand tokens on a complex question, the invisible part of the response sometimes exceeds the visible part. Add a detail that often confuses teams: grok-4.20-0309 does not return the reasoning content (reasoning_content) in clear text in the API response. You pay for a chain of thought you cannot read. This isn’t a reason to rule out reasoning, but a reason to enable it only where it truly changes result quality.
Prices as of August 5, 2026 — prices evolve regularly: before any budget calculation, check the current grid on the official xAI models and pricing page.
Key takeaways
- Four token types exist: text, image, cached (reduced rate), and reasoning (billed as output)
- Image tokens vary from 256 to 1,792 depending on image size and detail
- Cached tokens offer about 85% savings on grok-4.5
- Reasoning tokens are billed at the output rate, which can represent a significant cost
- Choose the right model for your need: grok-4.3 costs significantly less than grok-4.5, both for input and output