Grok API pricing explained
Updated 2026-11-01. Official xAI prices and rate limits, LMArena ranks.
Grok 4.7, xAI's flagship, costs $2 per 1M input tokens, $0.50 cached and $6 output on the xAI API. Grok 4.3 is $1.25 / $2.50 with a 1M-token context, and Grok Build 0.1, the coding model, is the cheapest at $1 / $2, per xAI's pricing docs. Prompts of 200K tokens or more bill the whole request at double the rate, the Batch API takes 20% off, and server-side tools like web search add $5 per 1,000 calls.
| Model | Input | Cached | Output |
|---|---|---|---|
| Grok 4.7 | $2 | $0.50 | $6 |
| Grok 4.3 | $1.25 | $0.20 | $2.50 |
| Grok Build 0.1 | $1 | $0.20 | $2 |
USD per 1M tokens, xAI API list price for prompts under 200K tokens, checked 2026-11-01. The last column is input / output once a prompt reaches 200K tokens. Source: xAI models and pricing.
Which Grok model should you use on the API?
- Grok 4.7 for most work. xAI says it's the model to use for everything outside images, video and voice, code included. Grok 4.7 ranks #16 of 50 priced models on LMArena's Code Arena and #17 of 37 on the agents board, with a 500K context window.
- Grok 4.3 when price or context matters more than peak quality. Grok 4.3 costs 58% less on output than 4.7 and holds 1M tokens, but ranks #46 of 50 on Code Arena. Its default reasoning effort is low, and it accepts a
nonesetting that turns reasoning off. - Grok Build 0.1 for coding agents on a budget. Grok Build 0.1 is $1 / $2 with a 256K context. It also answers to the
grok-code-fast-1alias, but it can't use the Batch API, so it gets no batch discount.
Older IDs are still on the price list: grok-4.6 costs the same as 4.7, grok-4.5 is the same except a $0.30 cached price, and the grok-4.20-0309 reasoning, non-reasoning and multi-agent models cost the same as 4.3, per xAI's pricing page.
How the 200K long-context price works
Every Grok text model has two prices. Once a prompt reaches 200K tokens, xAI bills all tokens in that request at the higher rate, not just the part above 200K. For Grok 4.7 that's $4 in, $1 cached and $12 out; for 4.3 and Build it's double their normal price.
Here's what that does to one request (our math): a 250K-token prompt with a 5K-token answer on Grok 4.7 costs $1.06. The same tokens at the short-prompt rate would cost $0.53. If you can trim a big repo or document dump under 200K, you pay half the rate. Grok 4.3's 1M window helps only if you're willing to pay the doubled rate for it.
Batch, priority and US endpoint pricing
| Option | Price | Catch |
|---|---|---|
| Batch API | 20% off every token type | Most jobs finish within 24 hours; batch requests don't count toward rate limits |
| Priority processing | 2x standard rates | Billed at 2x only when the response says service_tier is priority |
| US regional endpoint | 1.1x standard rates | us.api.x.ai keeps inference in the United States |
Multipliers apply to input, cached, output and reasoning tokens, per xAI's pricing page. Caching discounts are applied before the priority and US multipliers.
There's also Grok 4.7 Fast, the same model on faster hardware at 2x the token price (1.5x for long prompts). You can't call it on the public API. It's sold only inside Cursor and Grok Build, billed through those plans.
What Grok's tools cost
Server-side tools bill twice: once for the tokens the model reads and writes, and again per tool call. The model decides how many calls to make, so an open-ended research prompt can run up more calls than you'd expect.
| Tool | Fee on top of tokens |
|---|---|
| Web search | $5 per 1,000 calls |
| X search | $5 per 1,000 posts, $10 per 1,000 profiles |
| Code execution | $5 per 1,000 calls |
| File attachment search | $5 per 1,000 calls |
| Collections search (RAG) | $2.50 per 1,000 calls |
| Remote MCP, image and X video understanding | Tokens only, no call fee |
X search counts every post it returns, including parent and quoted posts, so one search that pulls 40 posts costs $0.20 in fees before tokens. Storage is extra too: files cost $0.025 per GiB a day, collections $0.10, and downloads $0.20 per GiB. Requests that break xAI's usage rules are still charged, and ones caught before generation carry a $0.05 fee, per xAI.
xAI API rate limits by tier
Your limits depend on how much you've spent on the xAI API in total since January 1, 2026, counting prepaid credits and paid invoices. Tiers go up on their own as you spend, and they never drop back down.
| Tier | Total API spend | Grok 4.7 RPS | 4.3 / Build RPS |
|---|---|---|---|
| Tier 0 | $0 | 150 | 37 |
| Tier 1 | $50 | 172 | 50 |
| Tier 2 | $250 | 208 | 75 |
| Tier 3 | $1,000 | 312 | 125 |
| Tier 4 | $5,000 | 500 | 208 |
RPS is requests per second, TPM tokens per minute, per model, from xAI's rate limit docs. Grok 4.6 and 4.5 match 4.7; the 4.20 models match 4.3, except multi-agent, which is lower.
Cached tokens still count toward TPM even though they're billed cheaply, and going over any limit returns a 429 error. Batch jobs don't count toward these limits at all, which is another reason to send bulk work through the Batch API.
What a month of Grok API use costs
List price, our math. Medium is 20M input and 5M output tokens a month; heavy is 200M and 50M. All prompts under 200K, no caching, no tools.
| Model | Medium month | Medium, batch |
|---|---|---|
| Grok 4.7 | $70.00 | $56.00 |
| Grok 4.3 | $37.50 | $30.00 |
| Grok Build 0.1 | $30.00 | No discount |
Grok API vs GPT, Claude and Gemini on price
Grok 4.7 matches GPT-6.1 Sol, Claude Sonnet 5.5 and Gemini 4 Argon on input at $2, and it's 40% cheaper on output. Of the US flagship models in this table, it's the cheapest for output-heavy work like code generation.
| Model | Input | Output | Medium month |
|---|---|---|---|
| Grok 4.7 | $2 | $6 | $70.00 |
| DeepSeek V4 Pro | $1.32 | $3.96 | $46.20 |
| GPT-6.1 Sol | $2 | $10 | $90.00 |
| Claude Sonnet 5.5 | $2 | $10 | $90.00 |
| Gemini 4 Argon | $2 | $10 | $90.00 |
| Claude Opus 5.5 | $4 | $20 | $180 |
Blended is 3 parts input to 1 part output. Prices from our API price table, checked 2026-11-01.
- Grok 4.7 vs GPT-6.1 Sol
- Grok 4.7 vs Claude Opus 5.5
- Grok 4.7 vs Gemini 4 Argon
- Grok 4.3 vs DeepSeek V4 Pro
Grok API or a Grok subscription?
The API is pay as you go per token, while Grok's Plus to Ultra plans give you the Grok apps with a shared usage pool. If you mostly chat in the app, a plan is simpler. If you're wiring Grok into your own code or agents, you need the API. Our Grok plan vs xAI API calculator shows where the break-even sits for your usage, and is Grok worth it compares the plans.
Sources
FAQ
How much does the Grok API cost?
Grok 4.7 costs $2 per 1M input tokens and $6 per 1M output tokens for prompts under 200K. Grok 4.3 is $1.25 / $2.50 and Grok Build 0.1 is $1 / $2, as of 2026-11-01.
What is the cheapest Grok API model?
Grok Build 0.1, at $1 input, $0.20 cached and $2 output per 1M tokens. It's built for coding agents and has a 256K context.
Does the Grok API charge more for long prompts?
Yes. Once a prompt reaches 200K tokens, the whole request is billed at the higher rate: $4 in and $12 out for Grok 4.7, double the normal price for Grok 4.3 and Build.
Does xAI have a batch discount?
Yes. The Batch API is 20% off all token types for Grok 4.7, 4.6, 4.5, 4.3 and the 4.20 models, with most jobs done within 24 hours. Grok Build 0.1 gets no batch discount.
What are the xAI API rate limits?
They depend on your total API spend since Jan 1, 2026. At Tier 0 ($0) Grok 4.7 allows 150 requests per second and 50M tokens per minute; at Tier 4 ($5,000 spent) it's 500 and 100M.
How much does Grok web search cost on the API?
$5 per 1,000 calls, on top of the tokens the model uses. X search is $5 per 1,000 posts returned and $10 per 1,000 profiles.
Related
- xAI API pricing, every model
- Grok 4.7 API pricing
- Grok plans vs xAI API calculator
- Grok limits per plan
- Cheapest LLM API
- OpenAI vs Anthropic API pricing
- Grok 4.7 vs Claude Opus 5.5
More guides
- GLM API pricing explained
- Qwen API pricing tiers explained
- StepFun API pricing explained
- ByteDance Seed API pricing explained
- DeepSeek Search and Fetch API pricing: what changes Oct 31
- Kimi API pricing explained
Not sure a plan beats the API for you? Try the plan vs API cost calculator.