At a glance
Grok 4 from xAI is a frontier model priced at US$3.00 per 1M input tokens and US$15.00 per 1M output tokens. For a typical solo-developer workload (8 hours/day, 22 days/month — 1 medium feature, 5 small bug fixes, 4 PR reviews, 2 stack-trace debugs, ~1500 lines of TypeScript, 1 large-doc read, with prompt caching at the default mix) Grok 4 costs about US$75/month. The 256K-token context window covers most monorepo scans without truncation.
What does your monthly budget buy?
Move the slider or switch task mix — values update live.
Monthly budget
US$100 / month
≈ $23/wk · ≈ $4.55/day
on Grok 4
Input tokens
45.3M
Output tokens
1.0M
Total tokens
46.3M
Per month this budget delivers
- Medium feature (10–15 files)78
- PR review987
- Lines of TypeScript272,108
- Small bug fix1,084
- Work email22,222
- Unit test file779
How does this model compare on price?
Input vs output per 1M tokens
- Grok 4US$3.00US$15.00
- Frontier median (other frontier models)US$2.00US$12.00
- Cheapest in catalog (Gemini 2.0 Flash)US$0.10US$0.40
Cost per task
At the default coding-agent mix with 50% cache hits.
USD per single task
- Lines of TypeScriptUS$0.0004
- Small bug fixUS$0.0923
- PR reviewUS$0.10
- Read a large docUS$0.13
- Debug from stack traceUS$0.23
- Refactor a module (8–12 files)US$0.90
- Medium feature (10–15 files)US$1.28
- Onboard to a new repoUS$1.31
Typical developer day
The 22-day month is based on the median working-day count across DE/US.
| Activity | Count | Per task | Daily | Monthly |
|---|---|---|---|---|
| Medium feature (10–15 files) | 1 | US$1.28 | US$1.28 | US$28.09 |
| Small bug fix | 5 | US$0.09 | US$0.46 | US$10.15 |
| PR review | 4 | US$0.10 | US$0.41 | US$8.91 |
| Debug from stack trace | 2 | US$0.23 | US$0.46 | US$10.08 |
| Read a large doc | 1 | US$0.13 | US$0.13 | US$2.89 |
| Micro-interaction (explain / lint fix) | 30 | US$0.00 | US$0.15 | US$3.22 |
| Lines of TypeScript | 1,500 | US$0.00 | US$0.55 | US$12.13 |
| Total | US$3.43 | US$75.46 | ||
The 1500-lines-of-TS row models ~1000 lines read (cache-hit) + ~500 lines written. Headline figures are precise to ~5% — see the FAQ.
Monthly cost matrix
What each monthly budget buys on this model (typical solo-developer day, 22 working days).
| Monthly budget | Medium features | PR reviews | Debug sessions | Lines of TS |
|---|---|---|---|---|
| Typical (≈ $75) | 59 | 745 | 329 | 205,340 |
| $50/month | 39 | 493 | 218 | 136,054 |
| $200/month | 156 | 1,975 | 872 | 544,217 |
| $500/month | 391 | 4,938 | 2,182 | 1,360,544 |
| $2000/month | 1,566 | 19,753 | 8,728 | 5,442,176 |
Typical mix: coding-agent (85% input, 50% cache hits). Values show the maximum count of each task type at that budget.
What this model can do
Coding
Trained or post-trained for code generation tasks.
Reasoning
Strong multi-step reasoning over complex prompts.
Multimodal
Accepts images alongside text.
Prompt cache
Cache reads billed at ~10% of input price — cuts agent costs sharply.
Batch API
Not supported
Tool use
Native function-calling / tool-use API support.
Long context
≥ 200K-token context window.
Extended thinking
Hidden reasoning tokens (Anthropic 'thinking' / OpenAI reasoning).
When does this model fit?
Best for
- Tasks needing recent data integration (X feed, live web)
- Alternative for teams wanting non-Anthropic, non-OpenAI lock-in
- Reasoning + coding at Sonnet-grade pricing
Watch out for
- No batch API
- Smaller ecosystem (fewer client libraries, less tooling)
xAI in the catalog
Total models
2
Median input/1M
US$1.60
Median output/1M
US$8.25
Input range
US$0.20–US$3.00
Related models
Sources
- xAI Models ↗
Verified: 2026-05-07
Frequently asked questions about Grok 4
What does a typical month on Grok 4 cost?
Running the realistic solo-developer day (1 medium feature + 5 small bug fixes + 4 PR reviews + 2 debug sessions + ~1500 lines of TypeScript + 1 large-doc read, 22 working days) on Grok 4 costs about US$75/month. Heavier workloads scale proportionally; lighter workloads cost less.
How big is Grok 4's context window?
256K tokens total, with up to 32K of output. That fits whole repository snapshots, tests included in a single call.
Why is Grok 4 output priced so much higher than input?
Providers charge US$15.00 per 1M output tokens against US$3.00 per 1M input — output requires real compute, input comes mostly from cache. Coding agents read many files (input-heavy) and emit compact diffs (low output), so total spend is usually input-driven.
How much does prompt caching save on Grok 4?
Cache reads typically cost only 10% of the regular input rate. On a coding-agent mix with 50% cache hits, that saves roughly 45% on input — which is about 38% off your total bill on input-heavy workloads. Anthropic models charge a one-time cache-write surcharge (25% over input) that pays for itself after 2–3 hits.
How do thinking tokens affect Grok 4's monthly bill?
Extended-thinking / reasoning tokens are billed at the full output rate but never appear in your visible response. On hard agentic tasks they can double your output bill, lifting the monthly total by 20–30%. Enable thinking only when the standard response visibly fails.
Try Grok 4 pricing live
Open the full calculator with your own budget, task mix and region (US or DE with 19% VAT).
Open calculator