grok-code-fast API Pricing
grok-code-fast on xAI costs $1.00 per 1M input tokens and $2.00 per 1M output tokens (as of ).
| Input | $1.00 / 1M tokens |
|---|---|
| Output | $2.00 / 1M tokens |
| Cached input (read) | $0.20 |
| Cache write | — |
| Batch input / output | — |
| Above 200K tokens (input / output) | $2.00 / $4.00 |
| Context window | 256K tokens |
| Max output | 256K tokens |
| Supports | vision, tool calling, reasoning, prompt caching |
| Deprecation date | None listed |
| API model id | grok-code-fast |
| In our records since |
What it costs for common jobs
Estimated from the list price above (no caching or batch discount).
| Job | Estimated cost |
|---|---|
| 1,000 chat replies (2,000 tokens in, 500 out each) | $3.00 |
| Summarising 100 long documents (50,000 in, 1,000 out each) | $5.20 |
| 1 million classification calls (300 in, 5 out each) | $310.00 |
Try your own numbers in the LLM API cost calculator.
Price history
- Between and : cached input price changed from $0.02 to $0.20 per 1M tokens.
- Between and : output price changed from $1.50 to $2.00 per 1M tokens.
- Between and : input price changed from $0.20 to $1.00 per 1M tokens.
Similarly priced models
| Model | Provider | Input / 1M | Output / 1M | Cached input / 1M | Context |
|---|---|---|---|---|---|
| grok-build-0.1 | xAI | $1.00 | $2.00 | $0.20 | 256K |
| grok-code-fast-1 | xAI | $1.00 | $2.00 | $0.20 | 256K |
| grok-4.20 | xAI | $1.25 | $2.50 | $0.20 | 1M |
| grok-4.20-0309-non-reasoning | xAI | $1.25 | $2.50 | $0.20 | 1M |
| grok-4.20-0309-reasoning | xAI | $1.25 | $2.50 | $0.20 | 1M |
| grok-4.20-beta | xAI | $1.25 | $2.50 | $0.20 | 1M |
| grok-4.20-beta-0309-non-reasoning | xAI | $1.25 | $2.50 | $0.20 | 1M |
| grok-4.20-beta-0309-reasoning | xAI | $1.25 | $2.50 | $0.20 | 1M |