An xAI estimate needs the model, prompt-length pricing tier and any tool or media operations. Use the live rows below to separate those charges and compare editable workload assumptions.
How xAI pricing works
Applicable text models have short- and long-context pricing. When a prompt reaches the documented long-context boundary, the corresponding rates apply to the request’s tokens, not only the portion beyond the boundary. Cached input remains a distinct charge category. Official documentation.
Check the tier against the entire assembled prompt. Conversation history, document excerpts and tool definitions can change its length even when the latest user message is short. Compare alternatives under the same request shape so one model is not given an artificially smaller workload.
Server-side tools add operation charges alongside token usage. A tool-using request can perform more than one operation before returning, so its final answer length alone does not explain the bill. Official documentation.

Full price list
| Model | Price type | USD | Unit | Tier | Region | Source |
|---|---|---|---|---|---|---|
| grok-4.20-0309-non-reasoning | Cached Input | $0.4 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Cached Input | $0.4 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Cached Input | $0.2 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Cached Input | $0.2 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Input | $2.5 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Input | $2.5 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Input | $1.25 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Input | $1.25 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Output | $5 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Output | $5 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Output | $2.5 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-0309-non-reasoning | Output | $2.5 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Cached Input | $0.4 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Cached Input | $0.4 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Cached Input | $0.2 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Cached Input | $0.2 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Input | $2.5 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Input | $2.5 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Input | $1.25 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Input | $1.25 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Output | $5 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Output | $5 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Output | $2.5 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-0309-reasoning | Output | $2.5 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Cached Input | $0.4 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Cached Input | $0.4 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Cached Input | $0.2 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Cached Input | $0.2 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Input | $2.5 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Input | $2.5 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Input | $1.25 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Input | $1.25 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Output | $5 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Output | $5 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Output | $2.5 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.20-multi-agent-0309 | Output | $2.5 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.3 | Cached Input | $0.4 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.3 | Cached Input | $0.4 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.3 | Cached Input | $0.2 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.3 | Cached Input | $0.2 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.3 | Input | $2.5 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.3 | Input | $2.5 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.3 | Input | $1.25 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.3 | Input | $1.25 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.3 | Output | $5 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.3 | Output | $5 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.3 | Output | $2.5 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.3 | Output | $2.5 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.5 | Cached Input | $0.6 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.5 | Cached Input | $0.6 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.5 | Cached Input | $0.3 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.5 | Cached Input | $0.3 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.5 | Input | $4 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.5 | Input | $4 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.5 | Input | $2 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.5 | Input | $2 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.5 | Output | $12 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.5 | Output | $12 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.5 | Output | $6 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.5 | Output | $6 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.6 | Cached Input | $1 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.6 | Cached Input | $1 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.6 | Cached Input | $0.5 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.6 | Cached Input | $0.5 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.6 | Input | $4 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.6 | Input | $4 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.6 | Input | $2 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.6 | Input | $2 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-4.6 | Output | $12 | per 1M tokens | long context | See source | Official source ↗ |
| grok-4.6 | Output | $12 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-4.6 | Output | $6 | per 1M tokens | short context | See source | Official source ↗ |
| grok-4.6 | Output | $6 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-build-0.1 | Cached Input | $0.4 | per 1M tokens | long context | See source | Official source ↗ |
| grok-build-0.1 | Cached Input | $0.4 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-build-0.1 | Cached Input | $0.2 | per 1M tokens | short context | See source | Official source ↗ |
| grok-build-0.1 | Cached Input | $0.2 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-build-0.1 | Input | $2 | per 1M tokens | long context | See source | Official source ↗ |
| grok-build-0.1 | Input | $2 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-build-0.1 | Input | $1 | per 1M tokens | short context | See source | Official source ↗ |
| grok-build-0.1 | Input | $1 | per 1M tokens | short context <200k | See source | Official source ↗ |
| grok-build-0.1 | Output | $4 | per 1M tokens | long context | See source | Official source ↗ |
| grok-build-0.1 | Output | $4 | per 1M tokens | long context ≥200k | See source | Official source ↗ |
| grok-build-0.1 | Output | $2 | per 1M tokens | short context | See source | Official source ↗ |
| grok-build-0.1 | Output | $2 | per 1M tokens | short context <200k | See source | Official source ↗ |
Last verified · Source ↗
The rows preserve billing types and conditions. Select the tier your request qualifies for rather than treating the lowest input row as a universal price. Missing values require source verification; they are not zero-cost operations.
For image, video or audio work, read the media unit explicitly. A duration-based rate and a token rate cannot be ranked as though they described the same quantity. Keep the requested output properties with your estimate.
Estimate your cost
Estimate your API costs
Your text and estimates stay in this browser. No API requests are sent to model providers.
Loading verified model records…
Enter observed prompt and output usage from a representative call. The calculator’s defaults are illustrative. It estimates supported token charges, so list excluded tool and media operations separately before approving a budget.
Three worked scenarios
Chatbot. Retained messages can make later turns more expensive than the initial greeting. Compare your actual history policy and observe cache behavior across turns.
Estimate your API costs
Your text and estimates stay in this browser. No API requests are sent to model providers.
Loading verified model records…
Summarization. Prompt assembly can cross a pricing boundary. Compare a focused document excerpt with the complete source before choosing the context tier.
Estimate your API costs
Your text and estimates stay in this browser. No API requests are sent to model providers.
Loading verified model records…
Coding assistant. Include repository context, diagnostic logs and follow-up reasoning. If tools are enabled, add their observed operations to the token-only estimate.
Estimate your API costs
Your text and estimates stay in this browser. No API requests are sent to model providers.
Loading verified model records…
How to reduce cost on xAI
xAI caches matching starting messages. Its guidance recommends a stable conversation identifier and unchanged earlier messages; changing or reordering a prefix can remove the expected benefit. Cache reuse should be measured, not assumed. Official documentation.
Cached usage appears in different fields for Chat Completions and Responses. Read the field appropriate to your endpoint when estimating the cached share. Official documentation.
The Batch API supports asynchronous work on eligible models. Review each model’s support and the batch request contract before assigning an offline evaluation job to that path. Official documentation.
Control tool scope as carefully as prompt length. Ask whether a request needs current retrieval at all, then inspect which tools were actually invoked. Evaluate a cheaper candidate on the full task, including failed attempts, rather than reduce cost by removing information required for a correct answer.
Billing, credits and limits notes
Team prepaid credits and monthly invoiced billing are separate payment arrangements. Auto top-up can buy additional credits, while the invoiced spending control governs a different part of the payment flow. Inspect both before assuming a balance is a fixed budget. Official documentation.
Match the console’s selected team to the key used by the application. Review the xAI free-access evidence and team rate limits when a request cannot proceed. Adding credit does not repair an invalid payload.
Price change history
- xAI · grok-build-0.1 — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-4.6 — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-4.5 — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-4.3 — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-4.20-multi-agent-0309 — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-4.20-0309-reasoning — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-4.20-0309-non-reasoning — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-build-0.1 — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-4.6 — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- xAI · grok-4.5 — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
Our history begins with recorded observations. It does not reconstruct all earlier prices. For billing reconciliation, retain actual per-request usage and the provider’s invoice or credit records with the model and task identifiers.
Use the AI API cost calculator to turn the model and workload you are considering into an estimate.
Last verified · Source ↗
Frequently asked questions
Are long-context rates charged only on excess tokens?
Can tool usage make a short answer expensive?
Where is cached usage in Responses?
Is the credit balance a complete spending cap?
What should I compare when changing models?
Sources
Last verified · Source ↗