Is xAI API free? Only partly. Creating an account and an API key costs nothing, and every Console account comes with a free Playground where you can test Grok models in the browser. Real API calls are not free: SpaceXSI (the company formerly branded xAI) bills them per token from prepaid credits, and the current docs list no free monthly allowance. The flagship grok-4.7 costs $2 per million input tokens and $6 per million output tokens.
Everything below comes from SpaceXSI's own pages, checked on October 21, 2026: the API overview, the developer pricing docs, the billing docs, the quickstart and the rate limits page. Prices are US list prices.
Is xAI API free? The short answer
Think of the xAI API as having three free parts and one paid part.
| What you want | Free? | What the docs say |
|---|---|---|
| A Console account and an API key | Yes | Sign up at console.x.ai and create a key on the API Keys page |
| Testing models in the Playground | Yes | "Playground included with every account" to try Grok before you write code |
| Calling the API from your own code | No | Usage based, billed per token from prepaid credits or a monthly invoice |
| Higher rate limits | Spend based | Tiers rise with cumulative API spend; Tier 0 is the default at $0 |
So the key itself is free, but a key with no credits behind it will not get answers. The billing docs say that with the default $0 invoiced billing limit, requests are "automatically rejected once your prepaid credits are depleted."
If you came here looking for a recurring zero cost developer API, Grok is not it. Our guide to free OpenAI API alternatives compares the labs that do offer one, such as Google's Gemini API through Google AI Studio.
What the free Playground gives you
The Playground lives inside the SpaceXSI Console. According to the API overview, you can chat with Grok, generate images and video, and try the latest models before writing any integration code. That makes it a sensible first stop if you are deciding between Grok and another model for a project.
What the Playground is not: a hidden free tier for your app. The same page says that "when you're ready to ship, API usage is billed per token." If you want to build something that runs on its own, you will need credits.
Grok API pricing in October 2026
Here are the current text model prices from the developer pricing docs, per million tokens, for prompts under 200,000 tokens.
| Model | Context window | Input | Cached input | Output |
|---|---|---|---|---|
grok-4.7 | 500k | $2.00 | $0.50 | $6.00 |
grok-4.6 | 500k | $2.00 | $0.50 | $6.00 |
grok-4.5 | 500k | $2.00 | $0.30 | $6.00 |
grok-4.3 | 1M | $1.25 | $0.20 | $2.50 |
grok-build-0.1 | 256k | $1.00 | $0.20 | $2.00 |
A few pricing rules matter more than the headline numbers:
- Long prompts cost double. Once a prompt reaches 200,000 tokens, the whole request is billed at the higher rate. For
grok-4.7that is $4 input and $12 output per million tokens. - Batch is cheaper. The Batch API takes 20% off standard rates for the main text models, with most jobs done within 24 hours.
- Priority costs twice as much. Priority Processing doubles every token type for lower latency.
- The US regional endpoint adds 10%. Requests to the US endpoint are billed at 1.1x global rates.
- Tools are billed on top. Web search, code execution and attachment search are $5 per 1,000 calls, and X search is $5 per 1,000 posts returned.
- Blocked requests can still cost money. The pricing docs say requests that violate the usage guidelines are still charged, with a $0.05 fee per request when the Responses API catches the violation before generation.
The API overview also lists image and video models, for example grok-imagine-image-2.0 from $0.04 per image and grok-imagine-video-1.5 from $0.08 per second of video, plus voice pricing.
What a small project actually costs
To make the numbers concrete, here is simple arithmetic using the list prices above. Say you send 1,000 requests to grok-4.7, each with about 1,000 tokens in and 500 tokens out. That is one million input tokens ($2) and half a million output tokens ($3), so about $5 in total before any tool calls. The same job on the Batch API would be 20% less. Your real bill depends on prompt length, reasoning tokens and which tools the model calls, so watch the Usage page in the Console.
How to get an xAI API key
The quickstart lays out the steps:
- Sign up at console.x.ai. You start on a Personal Team, which is where usage and billing are tracked.
- Add prepaid credits under Billing, then API spend management. You can also enter a promo code there if you have one.
- Create a key on the API Keys page and store it as an environment variable called
XAI_API_KEY. - Point your client at the base URL
https://api.x.ai/v1and call a model such asgrok-4.7.
The API works with the official xAI SDK and with OpenAI compatible clients by changing the base URL, which keeps switching costs low if you already have code written for another provider. If API keys are new to you, read what is an LLM API key first: it covers how billing attaches to a key and how to keep one safe.
Tip on spending: auto top up is optional. If you turn it on, the billing docs let you set the trigger balance, the top up amount (minimum $5) and a monthly maximum. Prepaid credits are not refundable except where the law requires it, so start small.
Does The X Subscription include the Grok API?
This is where many people get confused. The plans page for The X Subscription lists "Grok API access" as a feature from the $8 Plus tier upward. That does not mean free API calls.
The usage limits docs describe the weekly pool as covering eligible usage "across supported Grok and Cursor surfaces," and the plans page says that within Grok the pool covers Chat, Imagine, Voice and Bot. Neither page says that API calls made with your own key come out of that pool, while the developer docs describe the API as a separate, token billed account funded by Console credits. Until SpaceXSI documents otherwise, budget for the API as its own bill. Our guide to Grok subscription plans explains what each tier does include.
Rate limits on a new account
You do not have to pay a minimum to get rate limits. Every team starts at Tier 0, and tiers rise automatically as cumulative API spend since January 1, 2026 passes $50, $250, $1,000 and $5,000. Tiers never downgrade.
| Tier | Spend needed | grok-4.7 requests per second | grok-4.7 tokens per minute |
|---|---|---|---|
| Tier 0 | $0 | 150 | 50M |
| Tier 1 | $50 | 172 | 53M |
| Tier 2 | $250 | 208 | 60M |
| Tier 3 | $1,000 | 312 | 74M |
| Tier 4 | $5,000 | 500 | 100M |
Those Tier 0 limits are generous for a side project. The constraint for most people is credit, not throughput.
What happened to the free xAI credits?
Older tutorials often say the xAI API gives $150 a month in free credits. That was a data sharing program: teams could opt in to share their API requests with the company in exchange for monthly credits. Participants later posted the company's email saying the program would end at the end of May 2025. Today's billing docs and billing FAQ describe only prepaid credits and monthly invoicing, with no data sharing credits. If a page still promises free monthly Grok credits, check its date.
Pros and cons of the Grok API's pricing model
Pros
- Free account, free key and a free Playground for testing before you spend anything.
- Prepaid credits with a $0 invoice limit by default, so you cannot run up a surprise bill.
- OpenAI compatible endpoint, so trying Grok in existing code is cheap.
- Batch discounts and generous Tier 0 rate limits.
Cons
- No recurring free tier for production use.
- Prepaid credits are not refundable outside regions where the law requires it.
- Tool calls, long prompts and priority processing add up fast.
- The X Subscription's "Grok API access" line is easy to misread as free calls.
Who should pay for the Grok API
The xAI API is worth a few dollars of credit if you want Grok's live web and X search inside your own app, or if you want to compare its answers against the OpenAI API and the Anthropic API on your own prompts. If you only want to chat with Grok, the free Grok apps or a subscription are simpler. If you need free API calls every month, start with Google's free Gemini tier instead. For what Claude calls cost, see is the Anthropic API free.
For how Grok stacks up as an everyday assistant, see ChatGPT vs Claude vs Gemini vs Grok.
FAQ
What is the xAI API?
The xAI API is SpaceXSI's developer service for calling Grok models from your own code. You create a key in the Console at console.x.ai, test models free in the Playground, and pay per token from prepaid credits. The flagship grok-4.7 costs $2 per million input tokens and $6 per million output tokens. See the xAI API tool page and our comparison of free OpenAI API alternatives.
Is the xAI API key free?
Yes. Creating a SpaceXSI Console account and generating a key costs nothing. The key only works for paid calls once your team has prepaid credits or approved monthly invoicing.
Is the Grok API free with X Premium or The X Subscription?
Not in the sense of free calls. The plans page lists Grok API access from Plus upward, but the docs describe the weekly usage pool as covering Grok and Cursor surfaces, and API usage is billed per token through the Console.
Does xAI still give $150 in free API credits?
No. That came from a data sharing program that participants reported ended in May 2025. The current billing docs list only prepaid credits and monthly invoices.
How do I use the xAI API for the first time?
Sign up at console.x.ai, add credits, create a key, set the base URL to https://api.x.ai/v1 and call grok-4.7 with the xAI SDK or an OpenAI compatible client. Try your prompts in the free Playground first.
What is the cheapest Grok model on the API?
Among current text models, grok-build-0.1 is the lowest listed at $1 input and $2 output per million tokens, and grok-4.3 is $1.25 and $2.50. The Batch API cuts 20% off most text models.



