Verified 2025-09-22 · sourced from xAI
Grok 4 Token Calculator & Cost Guide
Estimate xAI Grok 4 API usage in dollars before you send a single request. Standard pricing is $3.00 per million input tokens and $15.00 per million output tokens with a 256K token context window.
Context window
256,000 tokens
Input price
$3.00 / 1M
Output price
$15.00 / 1M
Cached input
$0.750 / 1M
Usage scenarios
Compare standard and cached pricing (where available) across common workloads.
Scenario | Tokens in | Tokens out | Total tokens | Standard cost | Cached cost |
---|---|---|---|---|---|
Quick chat reply Single user question with a short assistant answer | 650 | 220 | 870 | $0.0052 | $0.0038 |
Coding assistant session Multi-turn pair programming exchange (≈6 turns) | 2,600 | 1,400 | 4,000 | $0.0288 | $0.0230 |
Knowledge base response Retrieval-augmented answer referencing multiple passages | 12,000 | 3,000 | 15,000 | $0.0810 | $0.0540 |
Near-max context run Large document processing approaching the 256K token limit | 225,280 | 30,720 | 256,000 | $1.14 | $0.630 |
Daily & monthly budgeting
Translate usage into predictable operating expenses across popular deployment sizes.
Profile | Requests/day | Tokens/day | Daily cost | Monthly cost | Cached daily | Cached monthly |
---|---|---|---|---|---|---|
Team pilot | 25 | 75,000 | $0.525 | $15.75 | $0.412 | $12.38 |
Product launch | 100 | 500,000 | $3.30 | $99.00 | $2.51 | $75.38 |
Enterprise scale | 500 | 3,000,000 | $21.00 | $630.00 | $16.50 | $495.00 |
Pricing notes
- Contexts above 128K tokens are billed with high-tier pricing; see official docs.
- Live search pricing is $0.025 per source (per 1K sources).
Frequently asked questions
How much does Grok 4 cost per 1,000 tokens?
At the published rates of $3.00 per million input tokens and $15.00 per million output tokens, a typical 1,000 token request (≈70% input, 30% output) costs about $0.0066.
Does Grok 4 offer cached input discounts?
Grok 4 drops input costs to $0.750 per million cached tokens. Using cached contexts, that same 1,000 token call totals $0.0050, a significant saving for chatbots and RAG systems.
What is the context window for Grok 4?
Grok 4 supports up to 256,000 tokens (256K), allowing large prompts and retrieval-augmented payloads in a single call.
How fresh is the Grok 4 pricing data?
Pricing is sourced from https://docs.x.ai/docs/models and was last verified on 2025-09-22. The calculator updates automatically when models.json is refreshed.