Skip to content
AI Dev Toolkit.
Esc
  • AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.Tool
  • LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.Tool
  • AI Model ComparisonCompare prices, context windows and features across models.Tool
  • AI Model Pricing PagesSpecs, real costs and cheaper alternatives for popular models.Tool
  • Context Window CheckerSee whether your text fits each model's context window.Tool
  • Subscription vs API CalculatorFind out whether a chat plan or the API is cheaper for you.Tool
  • GPU / VRAM CalculatorCheck how much VRAM a local model needs and which GPUs fit.Tool
  • Claude Code Error DatabaseExact Claude Code error messages with tested fixes.Tool

Provider

xAI API pricing: every model compared

xAI offers 7 models through its API in our data, priced from $1 to $2 per million input tokens. The newest is Grok 4.7, first listed on 2026-09-21.

Models
7
Cheapest input
$1
Priciest input
$2
Largest context
2,000,000
With caching
all
Open weights
none

Filter and sort xAI models in the comparison table

Cheapest

Grok Build 0.1xAI$1 in · $2 out

Largest context

Grok 4.20xAI2,000,000 tokens

Newest

Grok 4.7xAI2026-09-21

Line-up

Every xAI model and price

ModelInput / 1MOutput / 1MContextReleased
Grok 4.7$2$6500,0002026-09-21
Grok 4.6$2$6500,0002026-08-12
Grok 4.5$2$6500,0002026-07-08
Grok Build 0.1$1$2256,0002026-05-20
Grok 4.3$1.25$2.501,000,0002026-04-30
Grok 4.20$1.25$2.502,000,0002026-03-31
Grok 4.20 Multi-Agent$1.25$2.502,000,0002026-03-31

Prices in US dollars per 1M tokens, newest first. Release dates are when our source first listed the model.

Overview

xAI’s pricing at a glance

The spread between xAI’s cheapest and most expensive model is large: Grok 4.7 costs 2× more per input token than Grok Build 0.1. Picking the smallest model that does the job well is usually the biggest saving available, ahead of any discount.

All of the line-up has a cached-input price, which helps chatbots and agents that resend the same instructions. 2 of 7 can run through a batch API at a discount, for work that can wait up to a day. All accept images as input.

FAQ

xAI API questions

How much does the xAI API cost?

xAI's 7 models range from $1 to $2 per million input tokens, and output costs more than input on almost every model. The exact bill depends on your token volumes, which you can estimate in the LLM cost calculator.

What is xAI's cheapest model?

By blended price (three parts input to one part output) it is Grok Build 0.1, at $1 input and $2 output per million tokens. The most expensive is Grok 4.7.

Which xAI model has the largest context window?

Grok 4.20, with 2,000,000 tokens per request.

Does xAI offer prompt caching or batch discounts?

In our data, all of xAI's models have a published cached-input price and 2 of 7 have a published batch price. Both can cut costs substantially for repeated prompts or work that can wait.

Updated

Sources: OpenRouter models API and LiteLLM model prices and context windows, checked daily. Not affiliated with xAI. Confirm critical numbers on the provider’s pricing page. See our methodology.