xAI API pricing

Input and output price per 1 million tokens for 7 xAI models, with context window sizes. Updated 2026-11-09.

OpenAI (58) Qwen (41) Google (30) Mistral (20) Z.ai (17) Anthropic (15) DeepSeek (14) Meta (9) Meta Llama (8) Moonshot AI (8) Tencent (8) xAI (7) Aion Labs (6) ByteDance Seed (6) NVIDIA (6) Amazon (5) Cohere (5) Perplexity (5) Xiaomi (5) Inclusionai (4) MiniMax (4) Sakana (4)

Prices are USD per 1 million tokens. Updated 2026-11-09. Want a number for your own prompt? Use the token counter and cost calculator.

xAI API pricing per 1M tokens

ModelContextInput $/1MOutput $/1MCached input $/1MImages in
Grok 4.7x-ai/grok-4.7500K$2$6$0.5Yes
Grok 4.6x-ai/grok-4.6500K$2$6$0.5Yes
Grok 4.5x-ai/grok-4.5500K$2$6$0.3Yes
Grok Build 0.1x-ai/grok-build-0.1256K$1$2$0.2Yes
Grok 4.3x-ai/grok-4.31M$1.25$2.5$0.2Yes
Grok 4.20 Multi-Agentx-ai/grok-4.20-multi-agent2M$1.25$2.5$0.2Yes
Grok 4.20x-ai/grok-4.202M$1.25$2.5$0.2Yes

Quick facts