Grok API Pricing: Full Breakdown of Costs (Aug 2026)
On this page
In this guide, you'll learn what every current Grok model costs, how the billing works (including a few fees that aren't obvious), ways to cut your bill, and the options for using Grok completely free.
How much does the Grok API cost?
xAI's newest flagship, Grok 4.6, costs $2 per 1 million input tokens and $6 per 1 million output tokens, with a 500K token context window. That's the same rate as Grok 4.5, which it replaced at the top of the lineup a month later. Grok 4.3 stays in the lineup at $1.25 input and $2.50 output per 1M tokens with a 1M token window, and remains one of the cheapest frontier-class APIs available. For comparison, Claude Opus 4.8 costs $5 input and $25 output per 1M tokens, so Grok 4.6 is priced at 40% of Opus on input and 24% on output.
Here's the quick view of the current lineup:
| Model | Best for | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|---|
| Grok 4.6 | Newest flagship: long-running agents, coding, research | $2.00 | $6.00 |
| Grok 4.5 | Prior flagship, same price as 4.6 | $2.00 | $6.00 |
| Grok 4.3 | Reasoning, agentic tool calling, low hallucination rate | $1.25 | $2.50 |
| Grok 4.20 (reasoning / non-reasoning / multi-agent) | Older flagship family, same price as Grok 4.3 | $1.25 | $2.50 |
| Grok Build 0.1 | Coding and app building | $1.00 | $2.00 |
| Grok Imagine (image) | Image generation | $0.002–$0.01 / image | $0.02–$0.07 / image |
| Grok Imagine (video) | Video generation | — | $0.05–$0.14 / second |
| Voice API (realtime) | Real-time voice agents | — | $0.05 / minute |
All pricing in this article is sourced from xAI's official docs.
Note that this is the API, not the subscriptions. SuperGrok and X Premium are consumer plans for the Grok chat interface and the X app; they don't include API access, and the API doesn't require them. The API is a separate, pay-as-you-go developer product billed per token through the xAI Console.
How Grok API pricing works
The Grok API uses per-token, pay-as-you-go billing: you pay for the tokens you send (input) and the tokens the model generates (output). A token is a chunk of text, roughly three-quarters of an English word, so 1 million tokens is about 750,000 words. The API is OpenAI SDK compatible, so cost estimates translate directly if you're migrating from GPT models.
A few structural points worth knowing:
Output costs 2–3x input. Grok 4.3's $1.25-in/$2.50-out ratio is 2x, and the $2-in/$6-out rate on Grok 4.5 and 4.6 is 3x; most providers charge 4–6x more for output than input. Practically, this means generation-heavy workloads (long answers, content creation, verbose agents) are where Grok's pricing advantage is largest.
Reasoning tokens are billed. Grok's models can run in reasoning mode, where the model generates internal thinking tokens before answering. Those reasoning tokens are billed like any other generated tokens, even though you don't see them in the final response. The Grok 4.20 family makes the trade-off explicit with separate reasoning and non-reasoning variants at the same per-token price. Grok 4.5 instead exposes a reasoning effort parameter (low, medium, or high, with high as the default), so simple requests pay for maximum deliberation unless you dial it down. Grok 4.6 adds a fourth level, xhigh, above high.
Prompts of 200K tokens or more bill at double rates. Every current chat model now has two pricing tiers. Requests under 200K prompt tokens pay the standard rate; at 200K or more, input, cached input, and output all double, so Grok 4.6 moves to $4 input and $12 output per 1M tokens. This is new since our June update, when Grok 4.3's rate was flat across its full window. If a large job can be split into requests under the threshold, the split halves the rate.
Pricing can vary by region. xAI serves models from multiple clusters, and individual model pages in the docs list region-based pricing. If you're pinning requests to a specific data residency region, check the model's detail page rather than assuming the headline rate.
What can push your bill higher
Four things commonly push a real Grok bill above a simple token estimate.
Server-side tools charge per invocation
Grok's agentic tools each cost money per invocation on top of the tokens they consume. Current rates: Web Search, X Search, and Code Execution each cost $5.00 per 1,000 calls; File Attachments search costs $10.00 per 1,000 calls; and Collections Search (RAG) costs $2.50 per 1,000 calls. In agentic requests, the model decides how many tool calls to make. A single complex query might trigger five searches and two code executions, so tool costs scale with query complexity, not request count. The retrieved content also flows back into the model as billed input tokens.
Reasoning mode multiplies output tokens
A short visible answer can sit on top of thousands of billed reasoning tokens. If you're seeing higher-than-expected output token counts in your usage data, reasoning mode is the first place to look.
Storage and downloads are billed separately
Files stored on the platform cost $0.025 per GiB per day, and indexed collections (for RAG) cost 4x that at $0.10 per GiB per day. Downloading your own data back out costs $0.20 per GiB. None of these are large numbers, but a large RAG index left in place for months adds a recurring line to your bill.
The usage guidelines violation fee
This fee is specific to xAI: if a request violates the usage guidelines and gets blocked before generation, you're charged a $0.05 fee per blocked request, and requests flagged after generation are still billed for the tokens generated. For most developers this never comes up, but if you're running user-generated prompts at scale, moderating input on your side has a direct dollar value.
How to reduce Grok API costs
Grok 4.3 and the 4.20 family are flat-priced relative to each other, but the 4.5/4.6 flagship tier costs 60% more on input and 2.4x on output, so model choice is back as a lever. These are, in order of impact:
1. Turn off reasoning for simple tasks
Within any one model, the number of tokens generated is the cost difference, and reasoning mode is the largest multiplier on that number. Use the non-reasoning variant (or disable reasoning per request) for classification, extraction, formatting, and straightforward chat, and save reasoning mode for problems that need it. On Grok 4.5 and 4.6, set the reasoning effort parameter to low for simple tasks rather than leaving it at the default high. For many workloads, this halves output costs or better with no quality loss on the easy cases.
2. Use Grok 4.3 when the task doesn't need the flagship
Grok 4.6's edge is coding, long-running agents, and research work. For chat, summarization, and extraction, Grok 4.3 costs $1.25/$2.50 against the flagship's $2/$6 and scores well on factual-accuracy benchmarks. xAI claims the 4.5/4.6 generation is more token-efficient than comparable models, so on hard multi-step work the per-task gap may be smaller than the per-token gap suggests, but for routine traffic the cheaper model wins. Between 4.5 and 4.6, input and output rates are identical. The one difference is cached input, where 4.5 is cheaper at $0.30 per 1M against 4.6's $0.50, so a cache-heavy workload costs slightly less on the older model.
3. Use the Batch API for anything that can wait
The Batch API processes requests asynchronously, typically within 24 hours, at 20–50% off standard token rates, applied to every token type including reasoning and cached tokens. Batch requests also don't count against your rate limits, which makes it useful for bulk jobs like evaluations, dataset processing, and content moderation backlogs. The discount applies to text models only; image and video generation can run through Batch but at standard rates. Each model's exact batch price is on its detail page in the docs.
4. Structure prompts for caching
On Grok 4.3, cached input drops from $1.25 to $0.20 per 1M tokens, an 84% discount; on Grok 4.6 it drops from $2.00 to $0.50, 75% off, and on Grok 4.5 to $0.30, 85% off. Caching applies to repeated prompt prefixes, so put your static content (system prompt, instructions, shared documents) at the start of the prompt and the variable user content at the end. For chatbots and agents that resend a long system prompt on every request, this cuts input costs substantially.
5. Constrain tool use in agentic requests
Because the model autonomously decides how many $5-per-thousand tool calls to make, unconstrained agentic prompts are the least predictable line in a Grok bill. Scope your prompts ("search at most twice"), only enable the tools a request actually needs, and monitor per-request costs. The API returns exact cost data with each response, and the console's cost tracking breaks down spend by tool.
6. Cap output length
The standard advice still applies: set output limits and ask for concise or structured responses. With output at 2–3x input, this matters less on Grok than on other providers, but at high volume it still adds up.
Can you use the Grok API for free?
There's no permanent free tier on the xAI API itself, but there are two ways to use Grok models without paying, and the first scales to any number of users.
Puter.js: the User-Pays model
Puter.js is a JavaScript library that lets you add Grok models (including Grok 4.6, Grok 4.5, Grok 4.3, and Grok Build) to your app with no API key, no backend, and no bill to you as the developer. It works on the User-Pays model: each user of your app covers their own AI usage through their Puter account, so your cost stays at zero regardless of how many users you have.
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.chat(
"Explain quantum computing in a witty and engaging way.",
{ model: "x-ai/grok-4.6" }
).then(response => {
document.body.innerHTML = response.message.content;
});
</script>
</body>
</html>
We calculated this for a sample app: 500 monthly users sending 30 messages each, averaging 1,000 input and 300 output tokens per message, consumes 15M input and 4.5M output tokens a month. Through the xAI API on Grok 4.6, our estimate comes to about $30 for input and $27 for output, roughly $57 every month, scaling linearly as you grow. The same app through Puter.js costs you $0 at 500 users and still $0 at 50,000 users (where we calculate the API bill would have reached ~$5,700/month), because each user carries their own usage.
OpenRouter's free endpoints
OpenRouter periodically offers free variants of Grok models (tagged :free), useful for testing without any account spend. The limits make it a testing option only: 50 requests per day and 20 per minute on a free account, rising to 1,000 per day once you've purchased at least $10 in credits. Free endpoints also get rate-limited by upstream providers during peak times, and failed requests still count against your daily quota, so prototype on it but don't ship on it.
Real-world cost examples
We worked through a few common workloads using the same method each time: tokens per request × volume × the per-million rate, input and output calculated separately.
Customer support chatbot. 1,000 conversations a month, averaging 8 messages each, with ~1,200 input tokens (system prompt plus history) and 250 output tokens per message, so 9.6M input and 2M output tokens monthly. We calculate this at $12.00 input + $5.00 output ≈ $17/month on Grok 4.3, or about $31 on Grok 4.6. For comparison, we estimate the identical workload at ~$108/month on OpenAI's flagship. Add prompt caching (that repeated system prompt) and it drops to about $10.
Summarizing 100 PDFs. At ~20,000 tokens per document with 500-token summaries: 2M input, 50K output. On Grok 4.3, our calculation comes to about $2.63. Through the Batch API: roughly $1.30–$2.10 depending on the model's batch discount.
Daily content generation. 30 articles a month with 2,000-token prompts and ~4,000 output tokens each (reasoning included): we estimate about $0.38 a month. Effectively free.
Across all three, we found the same pattern: on Grok, low-to-mid volume workloads cost single-digit dollars.
Complete Grok API pricing table
All prices in USD, standard real-time rates.
Chat models (per 1M tokens)
| Model | Context | Input | Cached input | Output |
|---|---|---|---|---|
| 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 4.20 (reasoning) | 1M | $1.25 | $0.20 | $2.50 |
| Grok 4.20 (non-reasoning) | 1M | $1.25 | $0.20 | $2.50 |
| Grok 4.20 (multi-agent) | 1M | $1.25 | $0.20 | $2.50 |
| Grok Build 0.1 | 256K | $1.00 | $0.20 | $2.00 |
These are the rates for requests under 200K prompt tokens. At 200K or more, input, cached input, and output all bill at double the listed rate.
Image and video (Grok Imagine)
| Model | Input | Output |
|---|---|---|
| Image (quality) | $0.01 / image | $0.05 / image (1K), $0.07 / image (2K) |
| Image (standard) | $0.002 / image | $0.02 / image |
| Video | $0.01 / sec + $0.002 / image | $0.05 / sec (480p), $0.07 / sec (720p) |
| Video 1.5 preview (image-to-video) | $0.01 / image | $0.08 / sec (480p), $0.14 / sec (720p) |
Voice
| Mode | Price |
|---|---|
| Realtime voice | $0.05 / minute ($3.00 / hour) |
| Realtime text input | $0.004 / message |
| Text to speech | $15.00 / 1M characters |
| Speech to text | $0.10 / hour (REST), $0.20 / hour (streaming) |
Tools (per invocation, plus token costs)
| Tool | Price |
|---|---|
| Web Search | $5.00 / 1K calls |
| X Search | $5.00 / 1K calls |
| Code Execution | $5.00 / 1K calls |
| File Attachments search | $10.00 / 1K calls |
| Collections Search (RAG) | $2.50 / 1K calls |
| Image/video understanding, Remote MCP | Token-based only |
Storage and other fees
| Item | Price |
|---|---|
| File storage | $0.025 / GiB / day |
| Collection storage | $0.10 / GiB / day |
| File or collection downloads | $0.20 / GiB |
| Usage guidelines violation (pre-generation block) | $0.05 / request |
| Batch API | 20–50% off standard token rates |
xAI retired most legacy models (including the Grok 4 and Grok 3 families) in May 2026, with requests redirecting to current models, so if you're carrying old model names in your code, check the migration guide and the console's models page for what your team can actually access.
Conclusion
Grok 4.6 costs $2 per million input tokens and $6 per million output tokens with a 500K-token window, the same rate as the Grok 4.5 it replaces; Grok 4.3 costs $1.25 and $2.50 with a 1M-token window. Every current chat model doubles its token rates on requests of 200K prompt tokens or more.
The levers, in order of impact:
- Toggling reasoning off, or effort down, for simple tasks
- Choosing Grok 4.3 over the flagship when the task doesn't need it
- Caching repeated prompts for 75–85% off
- Batching non-urgent work for another 20–50%
- Constraining agentic tool calls
- Keeping large jobs under the 200K-token tier threshold
Prices were verified against xAI's official docs. Models retire and prices shift, so confirm current rates in the xAI Console before committing to a budget.
Related
- Free, Unlimited Grok API
- How to Get a Grok API Key
- Access Grok Using OpenAI-Compatible API
- How to Use Grok with the Vercel AI SDK
- OpenAI API Pricing
- Claude API Pricing
- Gemini API Pricing
- DeepSeek API Pricing
- Qwen API Pricing
- Mistral API Pricing
- Perplexity API Pricing
- MiniMax API Pricing
- Kimi API Pricing
- Z.ai GLM API Pricing
- Free, Unlimited AI API
- Free LLM API
Ship a Full-Stack App with One Prompt
Build an AI chat app using Puter.js
Coding manually? see the guide