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

Task mix

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
Open in the full calculator

How does this model compare on price?

Input vs output per 1M tokens

Hover a row to compare input vs output rates.
  • Grok 4
    US$3.00
    US$15.00
  • Frontier median (other frontier models)
    US$2.00
    US$12.00
  • Cheapest in catalog (Gemini 2.0 Flash)
    US$0.10
    US$0.40
Input per 1MOutput per 1M

Cost per task

At the default coding-agent mix with 50% cache hits.

USD per single task

Hover a bar to see per-task cost detail.
  • Lines of TypeScript
    US$0.0004
  • Small bug fix
    US$0.0923
  • PR review
    US$0.10
  • Read a large doc
    US$0.13
  • Debug from stack trace
    US$0.23
  • Refactor a module (8–12 files)
    US$0.90
  • Medium feature (10–15 files)
    US$1.28
  • Onboard to a new repo
    US$1.31

Typical developer day

The 22-day month is based on the median working-day count across DE/US.

ActivityCountPer taskDailyMonthly
Medium feature (10–15 files)1US$1.28US$1.28US$28.09
Small bug fix5US$0.09US$0.46US$10.15
PR review4US$0.10US$0.41US$8.91
Debug from stack trace2US$0.23US$0.46US$10.08
Read a large doc1US$0.13US$0.13US$2.89
Micro-interaction (explain / lint fix)30US$0.00US$0.15US$3.22
Lines of TypeScript1,500US$0.00US$0.55US$12.13
TotalUS$3.43US$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 budgetMedium featuresPR reviewsDebug sessionsLines of TS
Typical (≈ $75)59745329205,340
$50/month39493218136,054
$200/month1561,975872544,217
$500/month3914,9382,1821,360,544
$2000/month1,56619,7538,7285,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

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