Packaging

xAI adds a long-context rate column to Grok API pricing

xAI pricing

xAI restructured Grok API token pricing into short-context and long-context columns. Crossing a model's long-context threshold reprices every token in that request at roughly 2x.

Before

One rate per model per token type, split across separate Code API and Chat API tables — grok-4.5 $2.00 in / $6.00 out, grok-4.3 $1.25 / $2.50, grok-build-0.1 $1.00 / $2.00 per 1M tokens.

After

A single Text API table with short-context and long-context rates. Short context is unchanged; long context is grok-4.5 $4.00 in / $0.60 cached / $12.00 out, grok-4.3 and the grok-4.20 variants $2.50 / $0.40 / $5.00, grok-build-0.1 $2.00 / $0.40 / $4.00.

xAI’s docs pricing page now publishes two rate columns per model instead of one. The mechanic is stated plainly on the page: “Models with long context pricing bill the long context rates for all tokens in a request once its prompt reaches the model’s long context threshold.” That is a cliff, not a tier — a request that crosses the threshold does not pay a blended rate, it pays the higher rate on every input, cached, and output token in the call.

The same release folded the previously separate “Code API” (grok-build-0.1) and “Chat API” tables into a single “Text API” table, so the coding model and the chat models now sit on one rate card.

For buyers, prompt size becomes a first-class cost control on Grok: a RAG or long-transcript workload that habitually pushes past the threshold effectively pays double the headline rate, while the same token volume split across smaller requests stays on the short-context column.

From xAI's pricing timeline
Long-context rate column added; grok-4.5 cached input cut to $0.30

xAI merges the separate Code API and Chat API rate tables into a single Text API table and adds a second rate column for long context, roughly 2x the short-context rate: grok-4.5 $4.00 in / $0.60 cached / $12.00 out, grok-4.3 and the grok-4.20 variants $2.50 / $0.40 / $5.00, grok-build-0.1 $2.00 / $0.40 / $4.00. Crossing a model's long-context threshold reprices every token in that request, not just the tokens past the line. In the same release grok-4.5 cached input drops from $0.50 to $0.30 per 1M tokens (-40%), while short-context headline rates, agentic tool rates, Batch (−20%), Priority (2x) and consumer plans are unchanged. (Source: docs.x.ai/docs/pricing, live capture 2026-07-21.)

About xAI
x.ai ↗

xAI prices the Grok developer API per million tokens on a two-column short-context / long-context table split at a 200k-token prompt threshold: the grok-4.5 flagship (500k context) runs $2.00 input / $6.00 output short context (cached $0.30) and $4.00 / $12.00 long context, while grok-4.3 stays at $1.25 / $2.50 short (cached $0.20) and $2.50 / $5.00 long on a 1M-token context.

Free tier
Yes
Commits
None
Transparency
public

xAI pricing history

  1. Jul 2026
    Long-context rate column added; grok-4.5 cached input cut to $0.30
  2. Jul 2026
    grok-4.5 launches as the new flagship ($2 / $6 per 1M tokens)
  3. Jun 2026
    Live snapshot: grok-4.3 at $1.25 / $2.50, tools at $5 / 1k
  4. May 2026
    Lineup consolidates; legacy models retired
  5. Sep 2025
    Grok 4 Fast introduced (then later retired)
Full xAI timeline

More xAI activity

All pricing activity