xAI API

Grok 4.20 API Pricing 2026 — Cost per 1 Million Tokens

Current Grok 4.20 API pricing from xAI per 1 million tokens, including input, output and cached-token rates when available.

ModelRatePrice / 1M tokens
Grok 4.20
High-performance Grok model with 1M context and agentic tool calling.
1M context · text/image input · reasoning/non-reasoning variants · function calling.
For requests at or above 200K context, xAI lists higher long-context rates; rows marked long-context show those prices.
Input — <200K context$1.25
Grok 4.20Cached input — <200K$0.2
Grok 4.20Output — <200K$2.5
Grok 4.20Input — ≥200K context$2.5
Grok 4.20Cached input — ≥200K$0.4
Grok 4.20Output — ≥200K$5

How API token cost is calculated

Multiply the number of tokens by the provider rate, then divide by 1,000,000.

cost = tokens × price per 1M ÷ 1,000,000

Example: 250,000 input tokens at $2 / 1M = $0.50.

AI Price History