xAI API
Grok 4.20 API Pricing 2026 — Cost per 1 Million Tokens
Current Grok 4.20 API pricing from xAI per 1 million tokens, including input, output and cached-token rates when available.
| Model | Rate | Price / 1M tokens |
|---|---|---|
| Grok 4.20 High-performance Grok model with 1M context and agentic tool calling. 1M context · text/image input · reasoning/non-reasoning variants · function calling. For requests at or above 200K context, xAI lists higher long-context rates; rows marked long-context show those prices. | Input — <200K context | $1.25 |
| Grok 4.20 | Cached input — <200K | $0.2 |
| Grok 4.20 | Output — <200K | $2.5 |
| Grok 4.20 | Input — ≥200K context | $2.5 |
| Grok 4.20 | Cached input — ≥200K | $0.4 |
| Grok 4.20 | Output — ≥200K | $5 |
How API token cost is calculated
Multiply the number of tokens by the provider rate, then divide by 1,000,000.
cost = tokens × price per 1M ÷ 1,000,000
Example: 250,000 input tokens at $2 / 1M = $0.50.