API Pricing

xAI Grok API Pricing & Cost Calculator (2026)

Current xAI Grok API pricing per million tokens with a live cost calculator, worked examples, the output-price advantage explained and when Grok is the cheaper choice.

Compare xAI in the calculator → Visit xAI

xAI's Grok API is a frontier-class option with an unusual commercial trait: its output price is close to its input price, where most frontier APIs charge three-to-five times more for output. Combined with a very large context window, that makes Grok surprisingly economical for the response-heavy workloads where other frontier models get expensive. This page explains the pricing shape, walks through a worked example and shows when Grok is the right call. The table above is from a live feed; the cost calculator shows what your usage costs.

How Grok pricing works

Grok is billed per million input and output tokens, with a large context window (up to ~1M tokens) that reduces the need to chunk long inputs. Its defining feature is the flat-ish input/output ratio: because output isn't penalised the way it is elsewhere, the more your workload generates relative to what it consumes, the better Grok looks compared to its frontier peers.

This is exactly the kind of detail a headline "input price" comparison hides — and exactly what the calculator surfaces, because it models your real output length rather than just the input rate.

A worked example

An agent that writes long responses — say 2,000 input tokens but 4,000 output tokens per call, 20,000 calls a month:

input  = 2,000 tokens
output = 4,000 tokens   (2× the input)

On a typical frontier API where output costs ~5× input, that 4,000-token output dominates the bill. On Grok, with output priced close to input, the same call is far cheaper. Run this output-heavy profile in the calculator against OpenAI and Anthropic and Grok often wins precisely because of the output ratio — whereas on an input-heavy profile (lots of context, short answers) the ranking can flip.

When Grok is the right pick

Because the economics depend so much on your input/output mix, Grok is a strong example of why per-token sticker prices mislead: model your actual response length before deciding.

How to think about cost

  1. Estimate your real output length — this is where Grok's advantage lives; don't under-count it.
  2. Compare per-task, not per-token — as always, a model that succeeds first time beats a cheaper one you retry.
  3. Use the large context deliberately — it's convenient, but more input is still more cost; don't pad prompts just because you can.

Grok vs the alternatives

For input-heavy, high-volume simple work, cheaper tiers from Google and DeepSeek usually win. For agentic coding and the hardest reasoning, test against Anthropic and OpenAI. Where Grok distinguishes itself is the output-heavy frontier workload — there, its pricing shape can make it the most economical frontier option. The calculator is the fastest way to find out for your specific mix.

Frequently asked questions

Why is Grok cheaper than other frontier models for my agent? Most likely because your workload generates a lot of output, and Grok prices output close to input rather than at a 3–5× multiple. Output-heavy profiles favour Grok.

Does Grok support prompt caching? Where a cached input rate is available it's reflected in the calculator; otherwise input is billed at the standard rate. Check the model's row in the table above.

Is the large context window free? No — more input tokens always cost more. The big window is about capability (fitting more in one request), not free tokens.

When should I not use Grok? For input-heavy, short-output, high-volume tasks, cheaper balanced/fast tiers elsewhere typically come out ahead. Compare your exact scenario.

Compare Grok across the full field in the LLM API cost calculator.

Prices are auto-refreshed from a live source and dated. Confirm current pricing on xAI's page before committing.

xAI models & current pricing

API price = list price per 1M tokens (input → output). Sample cost = one request at 4,000 input + 1,000 output tokens. Use the full calculator for your own volume.

Model Context API price / 1M in → out Sample cost / request
Grok Build 0.1 fast 256K $1.00 $2.00 $0.006000
Grok 4.3 fast 1M $1.25 $2.50 $0.007500
Grok 4.20 Multi-Agent fast 2M $1.25 $2.50 $0.007500
Grok 4.20 fast 2M $1.25 $2.50 $0.007500

Estimates only; confirm current pricing on the provider's page. Prices auto-refresh every 12h.

API Pricing

OpenAI pricing

Up-to-date OpenAI API pricing per million tokens for the GPT-5 family, with a live cost calculator. Input, output, cached and batch pricing, worked examples and how to cut your bill.

API Pricing

Anthropic pricing

Current Anthropic Claude API pricing per million tokens — Opus, Sonnet, Haiku and Fable — with a live cost calculator, prompt-caching maths, worked examples and savings tips.