🤖
🤖 AI calculators

Grok API Cost Calculator (xAI models, caching & batch)

Results update as you type.

Your numbers

How it works

Cost per request = (uncached input tokens × input price + cached input tokens × cached-input price + output tokens × output price) ÷ 1,000,000, with prices in US$ per 1 million tokens. The cost of requests using Batch API is multiplied by the provider’s discount factor (0.8); models without a discount stay at full price. Day = request cost × requests per day; month = day × days per month; year = month × 12. “Saved” compares with the same traffic at the plain input and output price. Standard context (prompts under 200K tokens). Prompts from 200K tokens are billed at long-context rates (2x) for all tokens. Taxes, tools (web search, code execution), image or audio tokens, long-context surcharges and cache-write fees are not included.

xAI API prices (US$ per 1M tokens, checked 10 Nov 2026)

AI modelInput priceCached-input priceOutput priceBatch API input / output
grok-4.720.561.6 / 4.8
grok-4.620.561.6 / 4.8
grok-4.520.361.6 / 4.8
grok-4.31.250.22.51 / 2
grok-4.20 reasoning1.250.22.51 / 2
grok-4.20 non-reasoning1.250.22.51 / 2
grok-build-0.110.221 / 2

⚠ Estimates for information only — not financial advice.

FAQ

How big is xAI’s batch discount?

xAI lists a 20% discount on all token types for the Grok 4.x models sent through its Batch API. grok-build-0.1 has no batch discount.

What happens with prompts over 200K tokens?

xAI bills long-context rates — twice the standard rates — for every token in a request whose prompt reaches 200K tokens. This calculator uses standard rates, so split or trim very long prompts or enter your own prices.

Checked 10 Nov 2026. xAI official API pricing page (https://docs.x.ai/developers/pricing), read on 10 Nov 2026. Batch API: 20% off all token types on the Grok 4.x models listed (not grok-build-0.1).

🤖 All AI calculators →🌍 Calculators by country →