LimitDigest
Home / Guides / Grok API pricing explained

Grok API pricing explained

Updated 2026-11-01. Official xAI prices and rate limits, LMArena ranks.

Quick answer

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.

ModelBest forContextInputCachedOutput200K+ prompt
Grok 4.7Flagship: code, agents, chat500K$2$0.50$6$4 / $12
Grok 4.3Cheaper, 1M context1M$1.25$0.20$2.50$2.50 / $5
Grok Build 0.1Coding agents256K$1$0.20$2$2 / $4

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 none setting 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-1 alias, 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

OptionPriceWhich modelsCatch
Batch API20% off every token typeGrok 4.7, 4.6, 4.5, 4.3 and 4.20. No discount on Grok Build 0.1Most jobs finish within 24 hours; batch requests don't count toward rate limits
Priority processing2x standard ratesChat Completions and Responses onlyBilled at 2x only when the response says service_tier is priority
US regional endpoint1.1x standard ratesGrok 4.7 and 4.6 onlyus.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.

ToolName in the APIFee on top of tokens
Web searchweb_search$5 per 1,000 calls
X searchx_search$5 per 1,000 posts, $10 per 1,000 profiles
Code executioncode_execution$5 per 1,000 calls
File attachment searchattachment_search$5 per 1,000 calls
Collections search (RAG)collections_search$2.50 per 1,000 calls
Remote MCP, image and X video understandingTokens 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.

TierTotal API spendGrok 4.7 RPSGrok 4.7 TPM4.3 / Build RPS4.3 / Build TPM
Tier 0$015050M3710M
Tier 1$5017253M5015M
Tier 2$25020860M7525M
Tier 3$1,00031274M12545M
Tier 4$5,000500100M20885M

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.

ModelMedium monthMedium, batchHeavy monthHeavy, batch
Grok 4.7$70.00$56.00$700$560
Grok 4.3$37.50$30.00$375$300
Grok Build 0.1$30.00No discount$300No 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.

ModelInputOutputBlendedMedium month
Grok 4.7$2$6$3$70.00
DeepSeek V4 Pro$1.32$3.96$1.98$46.20
GPT-6.1 Sol$2$10$4$90.00
Claude Sonnet 5.5$2$10$4$90.00
Gemini 4 Argon$2$10$4$90.00
Claude Opus 5.5$4$20$8$180

Blended is 3 parts input to 1 part output. Prices from our API price table, checked 2026-11-01.

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

More guides