AI cost calculator
Grok API pricing calculator
Your monthly Grok API bill at xAI's list price. Grok 4.7 costs $2 per million input tokens and $6 per million output tokens, and every token in a request doubles in price once its prompt reaches 200,000 tokens.
Your inputs
Result
$1,650 a month on Grok 4.7
$5.50 per 1,000 requests.
- Cost per request
- $0.0055
- Cost per 1,000 requests
- $5.50
- Per month
- $1,650
- Per year
- $19,800
- Saved by prompt caching
- $450.00 a monthagainst the same requests with no cache hits
- Cheapest xAI model for this workload
- Grok Build 0.1$660.00 a month
Worked examples
Each row is the calculator run on the inputs shown, with every other input at its default.
| Workload | Model | Requests a day | Tokens in / out | Per month |
|---|---|---|---|---|
| Support chatbot | Grok 4.7 | 5,000 | 3,000 / 300 | $697.50 |
| Support chatbot on Grok 4.3 | Grok 4.3 | 5,000 | 3,000 / 300 | $344.25 |
| Coding agent on Grok Build | Grok Build 0.1 | 2,000 | 60,000 / 2,000 | $1,248 |
| Long prompts over 200k | Grok 4.7 | 300 | 250,000 / 3,000 | $5,949 |
| Nightly batch | Grok 4.7 | 5,000 | 20,000 / 1,000 | $5,520 |
How it is calculated
xAI bills input, cached input and output tokens at a price per million tokens. Each model has a short-context price and a long-context price; once a request's prompt reaches 200,000 tokens, every token in that request is billed at the long-context price.
The Batch API is 20% off on the Grok 4.x models and returns most results within 24 hours. Priority processing costs twice the standard price. The US regional endpoint keeps inference in the United States for 10% more.
Server-side tools are billed on top of tokens: web search and code execution are $5 per 1,000 calls and collections search $2.50 per 1,000. They are not included here. xAI's API docs are now published under the SpaceXSI name.
Questions
How much does the Grok API cost?
Per million tokens: Grok 4.7 is $2 input, $0.50 cached and $6 output; Grok 4.3 is $1.25, $0.20 and $2.50; Grok Build 0.1 is $1, $0.20 and $2. Prices double once a prompt reaches 200,000 tokens.
What is the Grok long-context price?
For prompts of 200,000 tokens or more, Grok 4.7 costs $4 input, $1 cached and $12 output per million tokens, and the higher price applies to every token in that request.
Is Grok cheaper than Claude or GPT?
Grok 4.7 output is $6 per million tokens against $10 for Claude Sonnet 5.5 and GPT-6.1 Sol, with the same $2 input price. The grey bars in the chart compare them on your workload.
What does Grok cost inside Cursor?
Grok 4.7 is in the weekly usage pool of Cursor's paid plans; beyond the pool Cursor bills the same $2 / $6 rates. See the Cursor pricing calculator.
Sources
- xAI: API pricing, checked 2026-10-29
Prices and plans change. This page was last checked on 2026-10-29. The data is open: llm-prices.json (CC BY 4.0).