xAI API
xAI's developer API for Grok models (text, coding, image/video), billed usage-based per token.
At a Glance
xAI API is an AI tool for Agent & RAG frameworks (category: Development & Code). Free access: Free plan. Documented: 1 plan with prices and limits.
- Category
- Agent & RAG frameworks
- Paid from
- $2 / $6 / Custom (xAI API)
- Free Option
- Free plan
- Plans
- 1
- Sources
- 5 verified sources
- Website
- x.ai (opens in a new tab)
Category: Development & Code · Agent & RAG frameworks
Features
xAI exposes Grok 4 and Grok 3 through an OpenAI-compatible REST API; Grok 4 Mini and Grok 3 Mini are smaller variants at lower prices. The API provides streaming, function calling, image understanding, and image generation via Aurora.
Billing is per token; a public pricing table at x.ai/api lists all current models. $5 credit per month is included in the free tier. Real-time web search and X platform search are directly integrated into model calls.
- Grok 4 and Grok 3 models with real-time web search
- Live search across X platform posts as a built-in feature
- Image understanding and generation via Aurora from Grok 3
- Streaming and function calling with an OpenAI-compatible API
- $5 credit per month in the free tier
- Dedicated high-throughput endpoints for enterprise
Prices and plans
| Tier | Price | Period | What you get |
|---|---|---|---|
| xAI API | $2 / $6 | Custom | API access to Grok 4.7, Grok 4.6, 4.3, and Grok Build (coding) Grok 4.7 matches 4.6: $2 / $6 below 200k, $4 / $12 at 200k+; cached $0.50 / $1.00. Fast variant is not on the public API. |
Prices per vendor, excl. taxes/VAT where applicable.
Interactive API cost calculator for xAI API models
Calculate raw developer and inference token costs based on public OpenRouter pricing. These are independent of monthly consumer web subscriptions (such as ChatGPT Plus or Claude Pro). Prices subject to change without notice.
Limits
Standalone token list, separate from consumer seats in Grok/xAI. Grok 4.7 matches Grok 4.6: $2 / $6 below 200k prompt tokens, $4 / $12 at 200k+, cached $0.50 / $1.00. Grok 4.7 Fast (2x token price) is only available in Cursor and Grok Build, not in the public API. Prices without currency conversion.
Alternatives and similar tools to xAI API
FAQ
Is xAI API available for free?
Yes. A permanently free plan is published, not a time-limited trial.
Where is the vendor of xAI API based?
xAI is based in the USA. Regardless of that location, data processing and privacy terms are governed by the vendor's own contract.
What plans does xAI API offer?
The catalog documents one plan with price, billing period, and included features.
Is xAI API currently available?
xAI API is still active: Active.
How we compare
We compare free access, paid entry, plan limits, features and the listed official sources. Unsourced figures stay marked as not published.
Only confirmed entries appear in the catalog. Prices, plans and limits come from listed official vendor pages. Missing figures stay marked as not published. Search results are ordered by Task match by default; category and task lists are alphabetical. Both can be switched to Free access first; neither is a quality ranking. The vendor page always wins.
Edited and checked by the AI Compare Ninja team
Sources
All details regarding plans, limits, and features are based on official vendor documentation and the primary sources verified below.
- https://docs.x.ai/docs/pricing
- https://x.ai/api
- https://docs.x.ai/developers/pricing
- https://docs.x.ai/docs/models
- https://x.ai/news/grok-4-7
Visit site (opens in a new tab)
Spotted an outdated figure? Vendor pages change without notice. Report an error