Back to all plans

xAI API

$1.25/$2.50 flagship · 4 modalities

xAI's official API spanning text, image, video, and voice modalities; flagship grok-4.3 at $1.25/$2.50 per 1M tokens with live search tools included

Token API
SubscriptionToken API
Official

Core models

grok-4.3grok-4.20-0309-reasoninggrok-4.20-0309-non-reasoninggrok-4.20-multi-agent-0309grok-build-0.1grok-imagine-imagegrok-imagine-image-qualitygrok-imagine-videogrok-imagine-video-1.5Grok Voice RealtimeGrok TTSGrok STT
grok-4.3

xAI's current flagship text model with 1M context at $1.25/$2.50 per 1M tokens; supports Web Search, X Search, code execution, and other server-side tools—the go-to for production agent applications needing live information.

grok-4.20-0309-reasoning

The reasoning-mode variant of Grok 4.20—shows step-by-step chain-of-thought, suited to math proofs, complex logical analysis, and tasks requiring transparent reasoning; 1M context at $1.25/$2.50 per 1M tokens.

grok-4.20-0309-non-reasoning

The standard-mode variant of Grok 4.20—skips chain-of-thought for faster responses, suited to everyday Q&A and code generation tasks that do not require visible reasoning; 1M context at $1.25/$2.50 per 1M tokens.

grok-4.20-multi-agent-0309

The multi-agent variant of Grok 4.20 designed for orchestration pipelines that decompose complex problems into parallel sub-tasks; 1M context at $1.25/$2.50 per 1M tokens, same price as the standard variants.

grok-build-0.1

The lowest-cost text model in xAI's API with 256K context at $1.00/M input and $2.00/M output; suited to high-frequency batch inference, cost-sensitive applications, and lightweight production calls that do not require ultra-long context.

See the official site for more models

Additional core model names still appear above, with full details on the latest official page.

Open official site

Plan details

grok-4.3

Flagship text modelRecommended
Input
$1.25
Output
$2.50
Official
Usage
xAI's current flagship with model id grok-4.3; 1M token context at $1.25/M input and $2.50/M output—competitively priced among flagship models and especially suited to complex reasoning, code generation, and multi-step agent tasks.
Models
Supports server-side Web Search (live internet) and X Search (live X content) tools—agents can invoke these automatically during generation to access current information; tool calls are billed at $5/1k on top of token costs.
Highlights
Also supports code execution sandbox ($5/1k), file attachment search ($10/1k), collection search (RAG, $2.50/1k), and remote MCP tools—suited to building production-grade agent applications that need integrated tool calling.
Deal
Batch API offers 20%–50% off for delay-tolerant offline jobs; the Responses API supports tool aliases like code_interpreter and file_search, though the Python xAI SDK gRPC API does not support those specific aliases.
Best for
Primary choice for complex reasoning, agent applications, and code generation

grok-4.20

Reasoning & standard variants
Input
$1.25
Output
$2.50
Official
Usage
grok-4.20 has two separate variants: grok-4.20-0309-reasoning (chain-of-thought reasoning, step-by-step transparent) and grok-4.20-0309-non-reasoning (standard, faster responses); same price for both at $1.25/M input and $2.50/M output with 1M context.
Models
grok-4.20-multi-agent-0309 is also available—designed for multi-agent orchestration with the same 1M context at $1.25/$2.50, suited to complex agent pipelines that decompose sub-tasks for parallel reasoning.
Highlights
Note: grok-4.20 and newer models do not support the logprobs and top_logprobs parameters—they are silently ignored if set; use an earlier model version if these fields are required.
Best for
Developers who need flexible reasoning depth control or multi-agent workflow orchestration

grok-build-0.1

Compact efficient
Input
$1.00
Output
$2.00
Official
Usage
The lowest-cost text model in xAI's API at $1.00/M input and $2.00/M output with a 256K context window (shorter than the flagship but sufficient for most tasks); suited to high-frequency inference and batch processing where long context is not required and cost control matters.
Models
Also eligible for Batch API discounts—a cost-effective entry point for large-scale application testing and lightweight production inference where delay tolerance is acceptable.
Best for
High-frequency batch inference, cost-sensitive applications, and lightweight production calls

Grok Imagine

Image & video generation
Input
$0.02
Output
image+
Official
Usage
Image generation has two quality tiers: grok-imagine-image (standard, $0.02/image) and grok-imagine-image-quality (high quality, $0.05/image); max image input 20MiB, supports jpg/jpeg and png, accepts any image/text input order.
Models
Video generation also has two versions: grok-imagine-video ($0.050/sec) and grok-imagine-video-1.5 ($0.080/sec); video supports Batch API queuing but is billed at standard rates without the batch discount.
Best for
Developers integrating image or video generation into applications

Grok Voice

Voice API
Input
$0.05
Output
min+
Official
Usage
Grok Voice API covers three scenarios: real-time conversation (Realtime at $0.05/min plus $0.004 per text message sent), text-to-speech (TTS at $15.00/1M characters), and speech-to-text (STT at $0.10/hr REST, $0.20/hr streaming).
Models
The Realtime Voice API supports sub-second low-latency conversations suited to voice assistants and real-time interactive applications; shares the same API key as text models with no additional setup.
Best for
App developers needing real-time voice, TTS, or STT capabilities

Notes

  • Server-side tool invocations are billed per call (Web Search/X Search/code execution at $5/1k each), in addition to token costs; once tools are enabled, the agent decides how many calls to make, so complex queries can scale costs linearly with tool usage.
  • Batch API supports all text/language models at 20%–50% off standard rates, typically completing within 24 hours; image/video generation can be queued via Batch API but is billed at standard rates without the discount.
  • Both grok-4.3 and grok-4.20 support 1M token context; grok-build-0.1 has a 256K context and is the lowest-cost text option ($1.00/$2.00), suited to batch reasoning tasks that do not need ultra-long context.
  • Priority Processing charges 2× token rates with higher scheduling priority on Chat Completions/Responses text requests; docs.x.ai states all prices are in USD.

Supported coding tools

xAI ConsoleREST APIPython xAI SDKResponses APIBatch API

Pricing and model data sourced from official vendor websites

General
6