xAI API Pricing, Models & Rate Limits (2026)
xAI trains the Grok family and ships an API built to be a drop-in swap for the OpenAI and Anthropic SDKs — change the base URL and key, keep the client code. Grok 4.3 and the Grok 4.20 pair are the current lineup, all sharing a 1M-token context window.
Also known as: Grok.
Models and prices
| Model | Input /M | Output /M | Blended /M |
|---|---|---|---|
| Grok 4.3 | $1.25 | $2.50 | $1.56 |
| Grok-4.20 Reasoning | $2.00 | $6.00 | $3.00 |
| Grok-4.20 | $2.00 | $6.00 | $3.00 |
2 legacy xAI models
| Grok-3 Mini | $0.26/M blended |
| Grok-3 | $2.50/M blended |
Speed
Fastest measured xAI model is Grok-4.20 at 104 tokens/sec (290ms TTFT), median across measured xAI models is 98 tokens/sec. See the full speed benchmark methodology.
Operational facts
Verified 2026-08-08 against source.
| OpenAI-compatible | Yes |
| API base URL | https://api.x.ai/v1 |
| Auth model | Bearer API key |
| Prompt caching | Not documented |
| Batch discount | Not documented |
| Free tier | Free starting credits for new accounts |
| Rate-limit model | Per-model rate limits scaled by account tier |
| Data residency | Not documented |
| Trains on API data | Not documented |
| SLA published | No |
Lifecycle
xAI has 2 legacy models still routable. Full dates and successors on the model deprecation tracker.
Switching to and from xAI
Calling xAI through All AI Ask
curl https://allaiask.com/api/v1/chat \
-H "Authorization: Bearer $ALLAIASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "grok-4.3", "messages": [{"role": "user", "content": "Hello"}]}'FAQ
Is xAI OpenAI-compatible?
Yes — xAI's API base (https://api.x.ai/v1) accepts the OpenAI SDK request/response shape, so existing OpenAI client code works with a base-URL and key swap.
Does xAI support prompt caching?
Not documented as of 2026-08-08 — we did not find a published prompt-caching feature for xAI. If that changes, this page updates.
Does xAI have a free tier?
Yes — Free starting credits for new accounts.
How much does the xAI API cost?
Current xAI models range from $1.56 to $3.00 per million blended tokens (3:1 input:output). Full per-model pricing is in the table below.
Where is xAI API data hosted?
Not documented as of 2026-08-08 — no published data-residency commitment found for xAI.
