xAI API pricing

xAI sells API access to the Grok model family. Every text model has two price tiers — standard, and a long-context tier that reprices the whole request once the prompt reaches 200K tokens.

Official price list: docs.x.ai

Current lineup

How xAI billing works

Long-context repricing on every text model: once a request's prompt reaches 200K tokens, ALL tokens in it bill at the long-context rate — roughly 2x input, output, and cached rates.

Cached input is per-model, typically 4–6x cheaper than fresh input.

Batch API: 20% off, but only on grok-4.3 and the grok-4.20 variants — grok-4.6 and grok-4.5 get no batch discount. Priority processing bills 2x, applied only when the response confirms service_tier: "priority".

Server-side tools bill per invocation on top of tokens: web/X search and code execution $5 per 1,000 calls, attachment search $10, collections search $2.50.

Every xAI model we price

The full catalog — including dated snapshots and variants — exactly as Marginal prices incoming usage events.

44 models
Cached input / 1M
grok-2$2.00$10.00128K
grok-2-1212$2.00$10.00128K
grok-2-latest$2.00$10.00128K
grok-2-vision$2.00$10.0032K
grok-2-vision-1212$2.00$10.0032K
grok-2-vision-latest$2.00$10.0032K
grok-3$3.00$15.00128K$0.75
grok-3-beta$3.00$15.00128K$0.75
grok-3-fast-beta$5.00$25.00128K$1.25
grok-3-fast-latest$5.00$25.00128K$1.25
grok-3-latest$3.00$15.00128K$0.75
grok-3-mini$0.30$0.50128K$0.075
grok-3-mini-beta$0.30$0.50128K$0.075
grok-3-mini-fast$0.60$4.00128K$0.15
grok-3-mini-fast-beta$0.60$4.00128K$0.15
grok-3-mini-fast-latest$0.60$4.00128K$0.15
grok-3-mini-latest$0.30$0.50128K$0.075
grok-4$3.00$15.00250K
grok-4-0709$3.00$15.00250K
grok-4-1-fast$0.20$0.502M$0.05
grok-4-1-fast-non-reasoning$0.20$0.502M$0.05
grok-4-1-fast-non-reasoning-latest$0.20$0.502M$0.05
grok-4-1-fast-reasoning$0.20$0.502M$0.05
grok-4-1-fast-reasoning-latest$0.20$0.502M$0.05
grok-4-fast-non-reasoning$0.20$0.502M$0.05
grok-4-fast-reasoning$0.20$0.502M$0.05
grok-4-latest$3.00$15.00250K
grok-4.20-0309-non-reasoning$1.25$2.501M$0.20
grok-4.20-0309-reasoning$1.25$2.501M$0.20
grok-4.20-beta-0309-non-reasoning$1.25$2.501M$0.20
grok-4.20-beta-0309-reasoning$1.25$2.501M$0.20
grok-4.20-multi-agent-0309$1.25$2.501M$0.20
grok-4.20-multi-agent-beta-0309$1.25$2.501M$0.20
grok-4.3$1.25$2.501M$0.20
grok-4.3-latest$1.25$2.501M$0.20
grok-4.5$2.00$6.00500K$0.30
grok-4.5-latest$2.00$6.00500K$0.30
grok-4.6$2.00$6.00500K$0.50
grok-beta$5.00$15.00128K
grok-build-0.1$1.00$2.00250K$0.20
grok-code-fast$1.00$2.00250K$0.20
grok-code-fast-1$1.00$2.00250K$0.20
grok-code-fast-1-0825$1.00$2.00250K$0.20
grok-vision-beta$5.00$15.008K

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.

Other providers

Using xAI in production?

Marginal prices every call your app makes against this catalog and slices spend by customer, feature, or any field you define. One track() call to integrate.