xAI API Pricing

Compare all 5 xAI models with detailed pricing, capabilities, and performance metrics.

All Models

Model NameCategoryInput PriceOutput PriceCached InputBatch InputContextMax OutputMultimodalFine-tuning
Grok 4
xAI flagship reasoning model for complex problem-solving.
Flagship$3.000000$15.000000$0.750000256K32.8KImage
Grok 4.1 Fast
Latest fast Grok model with massive 2M context window.
Mid-Tier$0.200000$0.500000$0.0500002M16KImage
Grok Code Fast
Specialized coding model optimized for software development.
Mid-Tier$0.200000$1.500000$0.020000256K32.8KText
Grok 3
Powerful general-purpose model with strong reasoning.
Flagship$3.000000$15.000000$0.750000131.1K16.4KImage
Grok 3 mini
Compact Grok model for cost-sensitive reasoning tasks.
Budget$0.300000$0.500000$0.070000131.1K16.4KText

Prices in USD per 1 million tokens. Data last updated 4/2/2026.

Compare xAI Models

Use the comparison tool to pit xAI models against each other or models from other providers:

Open Pricing Comparison

Estimate Your Costs

Calculate how much you'll spend with xAI's models based on your projected token usage.

Go to Cost Estimator

Frequently Asked Questions

How much does xAI API cost?
xAI offers a range of models with input pricing from $0.200000 to $3.00 per 1 million input tokens. Output pricing varies by model and ranges from $0.500000 to $15.00 per 1 million output tokens. Use the pricing comparison tool to see detailed breakdowns for all models.
Which xAI model is cheapest?
The Grok 4.1 Fast is xAI's most cost-effective option at $0.200000 per 1M input tokens. It supports Text + Image. Check the pricing table above to compare all available models or use the cost estimator tool for your specific use case.
Does xAI offer batch API pricing?
Currently, xAI does not appear to offer batch API pricing. However, pricing and features change frequently. Check xAI's official pricing page for the latest offerings.