Grok 4 API pricing

xAI's 2025 flagship — no longer on xAI's current price list; shown at its last catalog rate.

Tool callingPrompt cachingWeb search

Input

$3.00

per 1M tokens

Cached input

per 1M tokens

Output

$15.00

per 1M tokens

Context window

250K

max output 250K

Prices last synced Aug 20, 2026 from the LiteLLM community price catalog — the same catalog Marginal prices real usage events against, refreshed daily. Spot an error? Tell us.

What would Grok 4 cost you?

Enter your workload — add other models to compare the same traffic across providers.

Your monthly workload

Cache hit rate = share of input tokens served from the provider's prompt cache, billed at the model's cached-input price. Estimates use standard per-token rates — batch discounts, service tiers, and long-context surcharges are not applied.

Grok 4
ModelInputCached inputOutputPer requestMonthly
Grok 4$1,800$1,200*$3,750$0.013$6,750
Rates used: Grok 4 $3.00 in / $15.00 out

More from xAI

Tracking Grok 4 in production?

Marginal prices every call your app actually makes — cached tokens, dated snapshots, model switches included — and slices spend by customer or feature. One track() call to integrate.