xAI API
Grok 4.7 API Pricing 2026 — Cost per 1 Million Tokens
Current Grok 4.7 API pricing from xAI per 1 million tokens, including input, output and cached-token rates when available.
| Model | Rate | Price / 1M tokens |
|---|---|---|
| Grok 4.7 xAI's latest frontier Grok model for coding, agentic tasks and knowledge work. 500K context · text/image input · no text output limit · reasoning low/medium/high/xhigh. xAI charges the higher long-context tier when prompt tokens reach 200K or more. Grok 4.7 Fast is a separate Cursor/Grok Build-only variant billed at twice these token rates. | Input — <200K context | $2 |
| Grok 4.7 | Cached input — <200K | $0.5 |
| Grok 4.7 | Output — <200K | $6 |
| Grok 4.7 | Input — ≥200K context | $4 |
| Grok 4.7 | Cached input — ≥200K | $1 |
| Grok 4.7 | Output — ≥200K | $12 |
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.