xAI's Grok API pricing starts at $1.00 per million input tokens for the coding model grok-build-0.1 and $1.25 / $2.50 per million input / output tokens for grok-4.3, the cheapest general model with a 1 million token context window. The flagship grok-4.7 costs $2.00 input and $6.00 output per million tokens. These are the rates on xAI's pricing page (last updated October 10, 2026) as of November 14, 2026. There is no free Grok API tier today: the $25 monthly credit ended with the 2024 public beta, and the $150/month data-sharing credit ended in May 2025. The credit routes that still exist are Grok for Startups, a 10–20% credit rebate on X API spend, and promo codes entered in the console.
Whether you're evaluating Grok for a new project, comparing it against your current AI provider, or checking why an old integration now costs more, this guide covers what you need to decide. It lists the exact price of every current model, what the retired model names (Grok 4.1 Fast, Grok 4, Grok 3) bill at now, every credit program with its current status, costs next to OpenAI, Anthropic and Google, and a cost calculator you can redo with your own numbers.
Jump to: free credit status · what old model names cost now · cost calculator
Updated November 14, 2026. This guide was first published in January 2026. Since then xAI retired Grok 4.1 Fast, Grok 4 Fast, Grok 4 (0709), Grok 3 and Grok Code Fast 1 on May 15, 2026 (requests now go to
grok-4.3orgrok-build-0.1at their prices), launched Grok 4.20, 4.3, 4.5, 4.6 and 4.7, now lists a 20% Batch discount for current text models, and its docs now carry the SpaceXSI (SpaceX Super Intelligence) name. The January claims of "$175/month free credits" and "save 50%+" were removed because no current xAI page supports them.
What is Grok API? Quick Overview
The Grok API is the programmatic interface to xAI's family of large language models, so developers can put Grok models inside their own applications. Unlike the Grok chatbot on grok.com and X, the API gives you the models directly, with your own parameters, streaming, tools and per-token billing through the xAI Console at console.x.ai.
xAI launched Grok in November 2023 and opened the API as a public beta on November 4, 2024. The model line has turned over several times since. In November 2026 the docs recommend grok-4.7 for "everything else, including code", apart from the dedicated image, video and voice models. The API still accepts the OpenAI SDK with the base URL https://api.x.ai/v1, so switching often means changing the base URL, the key and the model name. The older Anthropic SDK compatibility is marked deprecated in favor of the Responses API.
Two points from the January version of this guide no longer hold. The 2 million token context window belonged to Grok 4.1 Fast and Grok 4 Fast, both retired; the largest window today is 1 million tokens on grok-4.3 and the Grok 4.20 models, and grok-4.7 has 500,000. Grok also has no built-in access to live X data: the docs state that the models know nothing beyond their training data unless you enable the server-side Web Search or X Search tools, which are billed per use (see the tool prices below). The benchmark score quoted in the January version had no source we could verify and was removed.
For developers, the practical value still comes down to three factors: the token price, the extra fees for tools and long prompts, and how easily the API fits into existing code. The following sections address each of these in detail.
Complete Grok API Pricing Table (November 2026)
Understanding Grok's pricing structure means looking at four things: the base token rates, the long-context rule, the multipliers for Batch, Priority and the US endpoint, and tool fees. Everything below comes from xAI's pricing page and models page as of November 14, 2026.
Standard Token Pricing
| Model | Input (per 1M tokens) | Cached input (per 1M) | Output (per 1M tokens) | Prompts of 200K tokens or more | Context window | Batch discount |
|---|---|---|---|---|---|---|
| grok-4.7 (flagship) | $2.00 | $0.50 | $6.00 | $4.00 / $1.00 / $12.00 | 500K | 20% |
| grok-4.6 | $2.00 | $0.50 | $6.00 | $4.00 / $1.00 / $12.00 | 500K | 20% |
| grok-4.5 | $2.00 | $0.30 | $6.00 | $4.00 / $0.60 / $12.00 | 500K | 20% |
| grok-4.3 | $1.25 | $0.20 | $2.50 | $2.50 / $0.40 / $5.00 | 1M | 20% |
| grok-4.20-0309-reasoning | $1.25 | $0.20 | $2.50 | $2.50 / $0.40 / $5.00 | 1M | 20% |
| grok-4.20-0309-non-reasoning | $1.25 | $0.20 | $2.50 | $2.50 / $0.40 / $5.00 | 1M | 20% |
| grok-4.20-multi-agent-0309 | $1.25 | $0.20 | $2.50 | $2.50 / $0.40 / $5.00 | 1M | 20% |
| grok-build-0.1 (coding) | $1.00 | $0.20 | $2.00 | $2.00 / $0.40 / $4.00 | 256K | none |
The cheapest model to call is grok-build-0.1, which xAI positions for agentic coding. For general text work the cheapest option is grok-4.3 or one of the three Grok 4.20 models at $1.25 / $2.50, which also have the largest context window. grok-4.7 costs 1.6 times as much for input and 2.4 times as much for output as grok-4.3.
Old model names: what Grok 4.1 Fast, Grok 4 and Grok 3 cost now
Many tutorials, SDK examples and price lists still use model names from early 2026. xAI retired them on May 15, 2026 at 12:00 PM PT. The names still work, but the requests are served by a newer model and billed at that model's price, per xAI's May 15 migration guide. The "before" prices come from xAI's models page as archived on March 12, 2026.
| Old model name | Price before retirement (input / cached / output per 1M) | Now served by | Billed now (input / cached / output) | Change |
|---|---|---|---|---|
grok-4-1-fast-reasoning, grok-4-1-fast-non-reasoning (Grok 4.1 Fast) | $0.20 / $0.05 / $0.50, 2M context | grok-4.3, low reasoning effort (non-reasoning slug: none) | $1.25 / $0.20 / $2.50, 1M context | input 6.25×, output 5× |
grok-4-fast-reasoning, grok-4-fast-non-reasoning (Grok 4 Fast) | $0.20 / $0.05 / $0.50 | grok-4.3, low / none | $1.25 / $0.20 / $2.50 | input 6.25×, output 5× |
grok-4-0709 (Grok 4) | $3.00 / $0.75 / $15.00, 256K | grok-4.3, low | $1.25 / $0.20 / $2.50 | input −58%, output −83% |
grok-3 | $3.00 / $0.75 / $15.00, 131K | grok-4.3, none | $1.25 / $0.20 / $2.50 | input −58%, output −83% |
grok-code-fast-1 | $0.20 / $0.02 / $1.50 | grok-build-0.1 | $1.00 / $0.20 / $2.00 | input 5×, output 1.33× |
grok-3-mini | $0.30 / $0.07 / $0.50 | Not on the current price page and not in the May 15 list | Check the Models page in your console | — |
If your code still sends grok-4-1-fast-reasoning because it was the cheapest model in January, the same traffic now costs roughly five to six times as much. Setting the model to grok-4.3 explicitly gives the same price but lets you choose the reasoning effort yourself instead of accepting the redirect default. The January version of this page also listed Grok 3 at $2 / $10 and Grok 3 Mini at $0.10 / $0.30; xAI's own list in March showed $3 / $15 and $0.30 / $0.50.
Cached Token Pricing
xAI caches prompt prefixes automatically. When a request starts with the same tokens as an earlier one and hits the cache, those tokens are billed at the cached rate. This matters most for applications with a long, fixed system prompt or a growing conversation history.
| Model | Cached input (per 1M) | Savings vs standard input |
|---|---|---|
| grok-4.7 / grok-4.6 | $0.50 | 75% |
| grok-4.5 | $0.30 | 85% |
| grok-4.3 / Grok 4.20 | $0.20 | 84% |
| grok-build-0.1 | $0.20 | 80% |
A cache hit is not guaranteed: xAI says entries can be evicted under load and requests can land on different servers. Sending the same x-grok-conv-id header (or prompt_cache_key on the Responses API) for a conversation routes it to the same server and raises the hit rate. Cached tokens still count toward your tokens-per-minute limit, and above 200K prompt tokens they are billed at the long-context cached rate.
Tool and Feature Pricing
Beyond basic token costs, certain features incur additional charges:
| Feature | Pricing | Notes |
|---|---|---|
Web Search (web_search) | $5 per 1,000 calls | Image search is part of web search |
X Search (x_search) | $5 per 1,000 posts, $10 per 1,000 profiles | Billed per item returned, not per call |
Code Execution (code_execution) | $5 per 1,000 calls | Python in a sandbox |
| File Attachments search | $5 per 1,000 calls | Searches files attached to messages |
| Collections Search (RAG) | $2.50 per 1,000 calls | Your uploaded document collections |
| Image and X video understanding | Token-based | Only for media found by search tools |
| Remote MCP tools | Token-based | No per-call fee |
| Image input in messages | Billed as image tokens | No separate fee |
| Function Calling | Standard token rates | No additional charge |
The tool pricing deserves attention because it can change the bill more than the model choice. The model decides how many tool calls to make, so costs rise with query complexity, and X Search counts every post returned, including parent and quoted posts.
Cost Per 1K Tokens (For Quick Reference)
For those accustomed to thinking in smaller units (prompts under 200K tokens):
| Model | Input (per 1K) | Cached input (per 1K) | Output (per 1K) |
|---|---|---|---|
| grok-4.7 / grok-4.6 | $0.002 | $0.0005 | $0.006 |
| grok-4.5 | $0.002 | $0.0003 | $0.006 |
| grok-4.3 / Grok 4.20 | $0.00125 | $0.0002 | $0.0025 |
| grok-build-0.1 | $0.001 | $0.0002 | $0.002 |
Long context, Batch, Priority and US endpoint
Four rules change the rates in the table above:
- Long context (200K+ prompt tokens). Once a request's prompt reaches 200,000 tokens, every token in that request is billed at the long-context rate, which is double the standard rate on all current text models. This includes cached and output tokens.
- Batch API: 20% off. The discount applies to
grok-4.7,grok-4.6,grok-4.5,grok-4.3and the three Grok 4.20 models, on input, output, cached and reasoning tokens. Models not on xAI's list, includinggrok-build-0.1, get no Batch discount. Most batches finish within 24 hours, and batch requests don't count toward rate limits.grok-4.7is on that list, even though some price comparisons say otherwise. - Priority Processing: 2×. Faster scheduling for Chat Completions and Responses requests, billed at twice the standard rate on all token types, and only when the response confirms
"service_tier": "priority". - US regional endpoint: 1.1×. Requests to
https://us.api.x.ai/v1run in the United States and cost 10% more. It currently serves onlygrok-4.7andgrok-4.6; forgrok-4.7that is $2.20 / $0.55 / $6.60 under 200K tokens.
"Grok 4.7 Fast" is not on the public API. xAI offers it only inside Cursor and Grok Build, billed through those plans at twice the standard token rate.
How to Get Free Grok API Credits: $25 and $150/month Status in 2026

There is no free Grok API tier in November 2026, and the two best-known offers, $25 in free credits and $150 a month for data sharing, have both ended. Here is every credit route and where it stands as of November 14, 2026.
| Credit route | What it was | Status on November 14, 2026 | Source |
|---|---|---|---|
| $25 free credits per month | Public beta offer announced November 4, 2024, "until the end of 2024" | Ended with the beta | xAI API Public Beta announcement |
| $25 on signup | A one-time signup credit widely cited in 2025–2026 | Not mentioned on any current xAI page; the quickstart says to sign up and "load it with credits" | xAI quickstart |
| $150 per month for data sharing | Opt-in credit for teams that had spent at least $5, not offered in the EEA, UK and some other countries | Ended in May 2025 (reported May 13, 2025); no current xAI docs page mentions it | Report on X, xAI billing docs |
| Grok for Startups | — | Open for applications; credits for Grok, Grok Build, Grok Bot and the Grok API | x.ai/startups, terms updated October 27, 2026 |
| X API spend rebate | — | Live: 10–20% of X API spend comes back as xAI API credits | X API pricing docs |
| Promo codes | — | The console's Billing page accepts a promo code; xAI publishes no public code | xAI billing docs |
| Console Playground | — | Free: every Console account can chat with Grok and test models before writing code | x.ai/api |
If a guide, video or AI answer tells you to switch on data sharing for $150 a month, check the date: that option no longer appears in the console. For free alternatives to the Grok API, such as other providers' free tiers, see our free Grok API guide.
Step 1: Create Your xAI Account
Go to console.x.ai and sign up. You can use an email address or a single sign-on login such as your X account; the sign-in methods are managed at accounts.x.ai. An X Premium subscription is not required for API access.
After registration you land on the console dashboard. A new team's API credit balance starts at zero unless a promotion or startup grant applies to it, so plan to buy credits before your first request outside the Playground.
Step 2: Generate Your API Key
From the dashboard, navigate to the "API Keys" section in the left sidebar. Click "Create New Key" and provide a descriptive name for your key. The system generates a secret key starting with "xai-" followed by a random string.
Copy this key immediately and store it securely. xAI follows security best practices by displaying the full key only once. If you lose it, you'll need to generate a new one. Never commit API keys to version control or share them in public code repositories.
Step 3: Verify Your Credits
Open Billing → API spend management in the console. There you can:
- see your current prepaid credit balance and any credit grants
- enter a promo code if you have one
- buy prepaid credits (by card or bank transfer; bank transfers take 2–3 business days)
- turn on auto top-up, with a minimum top-up of $5 and a monthly maximum you choose
By default the invoiced billing limit is $0, which means xAI uses only prepaid credits and rejects API requests once the balance reaches zero. Raising that limit switches the overflow to monthly invoicing on your saved payment method. API credits you buy are non-refundable.
Step 4: Enable Data Sharing (Optional, +$150/month)
This step no longer exists: xAI ended the $150/month data-sharing credit program in May 2025, and no current xAI pricing, billing or quickstart page mentions it. The program gave teams $150 of API credits each month if they let xAI use their API inputs and outputs for training. According to copies of xAI's old documentation, teams had to spend at least $5 first, the opt-in could not be reversed, and teams in the EEA, the UK and a few other countries were excluded.
Many pages and AI answers still describe the old toggle under Settings or Billing → Credits. If you can't find it, that is expected. If your team joined before the program closed and still sees a data-sharing grant under credit grants in the console, that grant is the only authority for your account; nothing on xAI's public pages promises new grants.
Credit Usage Tips
Make the credits you do have last:
-
Test in the Playground first: every Console account can try prompts and models there before you spend API credits.
-
Pick the model on purpose: the same $100 buys 80 million input tokens on
grok-4.3but 50 million ongrok-4.7, and output costs 2.4 times as much on 4.7. -
Watch spend per request: every API response includes
usage.cost_in_usd_ticks, the exact amount charged for that call after cache discounts and tool fees (divide by 10,000,000,000 to get dollars). -
Know the expiry dates: Grok for Startups credits expire six months after they are applied unless your approval email says otherwise, and the X API rebate is counted per billing cycle. Purchased API credits can't be refunded.
Grok for Startups credits
Grok for Startups is the one xAI program that hands out free API credit to new teams in November 2026. The credits sit in one balance that covers Grok, Grok Build, Grok Bot and the Grok API.
- Who qualifies: xAI checks for venture backing, a live product and a company email that matches your website. Personal email addresses are not approved.
- How much: not published. xAI says it sizes credits to your funding, revenue and current AI spend, aiming for about six months of realistic usage.
- How it's paid out: 20% when you are approved, the other 80% after the initial onboarding steps.
- Limits: one grant per company; credits expire six months after they are applied unless stated otherwise; they can't pay for taxes, X Premium or third-party products.
Free xAI credits from X API spend
If you also buy X API credits (the API for posts and users on X), xAI pays back part of that spend as free xAI API credits. The rate depends on your cumulative X API spend in the billing cycle: 0% up to $199, 10% from $200, 15% from $500 and 20% from $1,000. Spending $1,000 on X API credits returns $200 of xAI API credit. You have to link your xAI team to your X developer account in the X developer console, and the count resets each billing cycle.
Does a SuperGrok or X subscription include Grok API credits?
Not in any way xAI documents. The consumer plans, now sold as The X Subscription (Free, Plus $8, Premium $30, Super $100 and Ultra $200 per month), come with a weekly usage pool that xAI says covers Grok Bot and Grok models across Grok and Cursor. Older SuperGrok and X Premium plans keep working unless you switch. API keys from console.x.ai are billed separately, per token, from your team's prepaid credits or monthly invoice.
One detail adds doubt: the Grok app's usage screen breaks the weekly pool down by product, and "API" is one of the listed lines. xAI's API docs never say that a console API key draws from a subscription, so budget the API as a separate cost and check Settings → Usage in Grok and Billing in the console if you want to confirm for your own account.
Grok vs ChatGPT vs Claude: API Pricing Comparison

Choosing between AI providers requires understanding how pricing translates to real-world costs. The tables below use each provider's official pricing page as of November 14, 2026, standard tier, prompts under each provider's long-context threshold. Per-token prices say nothing about quality; test your own prompts before switching.
Flagship Model Comparison
| Provider | Model | Input/1M | Cached input/1M | Output/1M | Long-context rule | Batch discount |
|---|---|---|---|---|---|---|
| xAI | grok-4.7 | $2.00 | $0.50 | $6.00 | All tokens ×2 from 200K prompt tokens | 20% |
| OpenAI | GPT-6.1 Sol | $2.00 | $0.10 | $10.00 | Higher rates above 272K input tokens ($4 / $0.20 / $15) | Batch prices are half |
| Anthropic | Claude Sonnet 5.5 | $2.00 | $0.10 | $10.00 | No surcharge on the 1M window | 50% |
| Gemini 4 Carbon | $2.00 ($4.00 from Dec 1, 2026) | $0.10 ($0.20) | $10.00 ($20.00) | No prompt-size tier | 50% |
At the flagship tier, all four charge $2 per million input tokens, and grok-4.7 has the lowest output price at $6. The others cache more cheaply ($0.10 against $0.50) and give a larger Batch discount, so a workload dominated by repeated long prompts or overnight batches can come out cheaper elsewhere. Gemini 4 Carbon's price doubles on December 1, 2026.
Budget Model Comparison
| Provider | Model | Input/1M | Cached input/1M | Output/1M | Notes |
|---|---|---|---|---|---|
| xAI | grok-4.3 | $1.25 | $0.20 | $2.50 | 1M context; ×2 from 200K; Batch 20% |
| xAI | grok-build-0.1 | $1.00 | $0.20 | $2.00 | Coding model, 256K, no Batch discount |
| OpenAI | GPT-6 Luna | $0.10 | $0.01 | $0.50 | Higher rate above 272K input |
| Anthropic | Claude Haiku 5.5 | $0.10 | $0.01 | $0.50 | Prompts over 100K: $0.50 / $0.05 / $2.50 |
| Gemini 3.8 Flash | $0.75 ($1.50 from Jan 1, 2027) | $0.075 | $3.75 ($7.50) | Free tier available | |
| Gemini 3.5 Flash-Lite | $0.30 | $0.03 | $2.50 | Free tier available |
This is the biggest change since January. Grok 4.1 Fast at $0.20 / $0.50 used to be among the cheapest models on the market; after its retirement the cheapest general Grok model is grok-4.3 at $1.25 / $2.50. GPT-6 Luna and Claude Haiku 5.5 now list $0.10 / $0.50, which is about one-twelfth of grok-4.3's input price and one-fifth of its output price. Choose Grok's budget tier for its 1M context window or because it handles your task better in tests, not because it is the cheapest per token.
For detailed analysis of competitor pricing, see our guides on Claude API pricing structure, GPT-4o API pricing, and Gemini API pricing options.
When to Choose Each Provider
Choose Grok when:
- You need live X (Twitter) posts and profiles in answers through the X Search tool
- You want a 1M token context window at $1.25 / $2.50 (
grok-4.3) - Output-heavy flagship work, where
grok-4.7's $6 output price is the lowest of the four - You are building for X or already buy X API credits (the X API rebate pays part of your xAI bill)
Choose OpenAI when:
- You have existing OpenAI integration to maintain
- You need the lowest-priced small model (GPT-6 Luna) at high volume
- Enterprise compliance requires established providers
- Long prompts sit between 200K and 272K tokens, where Grok has already doubled
Choose Claude when:
- Complex coding tasks are primary use case
- Safety and alignment are critical concerns
- Prompts are long and repeated, so the $0.10 cache price pays off
- Long document analysis with nuanced understanding
Choose Gemini when:
- Multimodal capabilities (video, audio) are essential
- Google Cloud integration simplifies infrastructure
- Free tier limits on Flash or Flash-Lite cover your usage
- You can use Batch for 50% off
Total Cost of Ownership
Beyond per-token pricing, consider these factors:
| Factor | Grok | OpenAI | Claude | Gemini |
|---|---|---|---|---|
| Free API tier | None published (startup credits, X API rebate) | Not covered here | Not covered here | Free tier on Flash, Flash-Lite and Hydrogen |
| Cached input vs standard input (flagship) | 25% of input price | 5% | 5% | 5% |
| Batch discount | 20% (listed models) | Half price | 50% | 50% |
| Long-context surcharge | ×2 for all tokens from 200K | Above 272K | Haiku only, above 100K | None on current models |
| Rate limits | Spend tiers: $0, $50, $250, $1,000, $5,000 | Not covered here | Not covered here | Not covered here |
For teams that call several providers, laozhang.ai's public model list (updated November 13, 2026) offers grok-4.7, grok-4.6, grok-4.5, grok-4.3, the Grok 4.20 models and grok-build-0.1 at the same per-token prices as xAI's list, alongside other vendors' models under one key.
Real-World Cost Examples: How Much Will You Pay?
Abstract pricing means little without concrete examples. These are the same three workloads as in the January version, recalculated with the November 14, 2026 rates. None of the prompts reaches 200K tokens, so standard rates apply.
Scenario 1: Customer Support Chatbot
A mid-size e-commerce company processes 10,000 customer conversations daily. Each conversation averages 8 exchanges, with 500 input tokens and 400 output tokens per exchange.
Daily token usage:
- Input: 10,000 × 8 × 500 = 40,000,000 tokens
- Output: 10,000 × 8 × 400 = 32,000,000 tokens
Monthly cost with grok-4.3:
- Input: 40M × 30 × $1.25/M = $1,500
- Output: 32M × 30 × $2.50/M = $2,400
- Total: $3,900/month
If half of every prompt is a fixed system prompt that hits the cache, the input drops to 600M × $1.25 + 600M × $0.20 = $870, and the month comes to $3,270.
The same month on other models:
| Model | Input | Output | Total |
|---|---|---|---|
| grok-4.3 | $1,500 | $2,400 | $3,900 |
| grok-4.7 | $2,400 | $5,760 | $8,160 |
| GPT-6 Luna | $120 | $480 | $600 |
| Claude Haiku 5.5 | $120 | $480 | $600 |
| Gemini 3.8 Flash (to Dec 31, 2026) | $900 | $3,600 | $4,500 |
In January this workload cost $720 on Grok 4.1 Fast. An integration that still sends grok-4-1-fast-* now pays the grok-4.3 price, $3,900.
Scenario 2: Code Review Assistant
A development team processes 50 pull requests daily, each averaging 15,000 input tokens (code context) and 3,000 output tokens (review comments).
Monthly token usage:
- Input: 50 × 15,000 × 30 = 22,500,000 tokens
- Output: 50 × 3,000 × 30 = 4,500,000 tokens
Cost comparison:
| Model | Input Cost | Output Cost | Total |
|---|---|---|---|
| grok-4.7 | $45.00 | $27.00 | $72.00 |
| grok-4.3 | $28.13 | $11.25 | $39.38 |
| grok-build-0.1 | $22.50 | $9.00 | $31.50 |
| GPT-6.1 Sol | $45.00 | $45.00 | $90.00 |
| Claude Sonnet 5.5 | $45.00 | $45.00 | $90.00 |
| Gemini 4 Carbon (to Nov 30, 2026) | $45.00 | $45.00 | $90.00 |
For code review, grok-4.7 at $72/month is the cheapest of the four flagships because review comments are output tokens. grok-build-0.1 costs less still, but it has no Batch discount and a 256K window.
Scenario 3: Document Analysis Pipeline
A legal tech startup processes 200 contracts daily, each 25,000 tokens with 5,000 token summaries.
Monthly usage:
- Input: 200 × 25,000 × 30 = 150,000,000 tokens
- Output: 200 × 5,000 × 30 = 30,000,000 tokens
Monthly costs:
| Model | Cost | With Batch API (−20%) |
|---|---|---|
| grok-4.3 | $262.50 | $210.00 |
| grok-4.7 | $480.00 | $384.00 |
| grok-4.5 | $480.00 | $384.00 |
Overnight document work suits the Batch API, which takes 20% off every token type. The prompt cache helps less here, because each contract is different; only shared instructions at the start of each prompt would hit it. Keep each request below 200K prompt tokens: a 300K-token bundle on grok-4.3 is billed at $2.50 / $5.00 for the whole request.
Grok API Cost Calculator: Formula and Monthly Cost Table
For your own estimates, use this formula:
cost per request = ( uncached input tokens × input rate
+ cached input tokens × cached rate
+ (output + reasoning tokens) × output rate ) ÷ 1,000,000
+ tool fees
rates: use the long-context row for the whole request if the prompt is 200,000 tokens or more
Batch: × 0.8 (listed models only) · Priority: × 2 · US endpoint: × 1.1
monthly cost = cost per request × requests per monthThe table below runs that formula for a typical chat request of 2,000 input tokens and 500 output tokens, with no tools.
| Model | Cost per request | 10,000 requests/month | 100,000 requests/month | 1,000,000 requests/month |
|---|---|---|---|---|
| grok-4.7 / 4.6 / 4.5 | $0.0070 | $70 | $700 | $7,000 |
| grok-4.3 / Grok 4.20 | $0.00375 | $37.50 | $375 | $3,750 |
| grok-build-0.1 | $0.0030 | $30 | $300 | $3,000 |
| grok-4.7, 1,500 of 2,000 input tokens cached | $0.00475 | $47.50 | $475 | $4,750 |
| grok-4.3, 1,500 of 2,000 input tokens cached | $0.002175 | $21.75 | $217.50 | $2,175 |
Add $0.005 for each Web Search call and $0.005 for each X post returned by X Search. A request that runs three web searches and pulls 60 posts adds $0.315 in tool fees, which is more than 40 plain grok-4.7 chat requests. To check your real numbers afterward, read usage.cost_in_usd_ticks from each response.
Hidden Costs: Tools, Search, and Context Pricing
Token pricing headlines don't capture the full cost picture. Several factors can significantly increase your actual bill.
Tool Invocation Costs
When your application uses Grok's built-in server-side tools, two things are billed: the tokens the model reads and writes during the agent loop, and a fee per tool use.
| Tool Type | Cost | Example Use Case |
|---|---|---|
| Web Search | $5.00 per 1,000 calls | Real-time data retrieval |
| X Search | $5.00 per 1,000 posts, $10.00 per 1,000 profiles | Monitoring posts and accounts on X |
| Code Execution | $5.00 per 1,000 calls | Running generated code |
| File Attachments search | $5.00 per 1,000 calls | Searching documents attached to messages |
| Collections Search | $2.50 per 1,000 calls | RAG over uploaded collections |
A chatbot that searches the web for every query adds $5 per 1,000 queries. X Search grows faster: a query that returns 50 posts costs $0.25 in tool fees alone. Decide whether your use case needs live data, and cap how many results a search may return.
Large Context Pricing
All current Grok text models bill a request at long-context rates once its prompt reaches 200,000 tokens, and the higher rate applies to every token in that request, not only the part above the threshold.
grok-4.7, prompt of 250,000 tokens with 5,000 output tokens: 0.25M × $4.00 + 0.005M × $12.00 = $1.06- The same request priced at the standard rates would be $0.53
Splitting long jobs so each prompt stays under 200K tokens halves the rate. The January version said a 25% premium "may" apply; xAI's current rule is a flat doubling.
Reasoning Token Costs
Reasoning models think before answering, and those reasoning tokens are billed at the output (completion) price. A short question can therefore produce several times more billable output than the visible answer. On grok-4.7 and grok-4.6 the reasoning effort can be set to low, medium, high (the default) or xhigh, and grok-4.3 adds a "none" level; lower effort means fewer reasoning tokens.
Monitor your actual token consumption versus expected usage. If you see significant discrepancies, reasoning tokens are likely the cause.
Rate Limit Considerations
xAI's rate limits rise with your team's cumulative API spend since January 1, 2026. Tiers unlock automatically and never drop:
| Tier | Cumulative spend | grok-4.7 / 4.6 / 4.5 (requests/sec, tokens/min) | grok-4.3 / 4.20 / build-0.1 (requests/sec, tokens/min) |
|---|---|---|---|
| Tier 0 | $0 | 150 RPS, 50M TPM | 37 RPS, 10M TPM |
| Tier 1 | $50 | 172 RPS, 53M TPM | 50 RPS, 15M TPM |
| Tier 2 | $250 | 208 RPS, 60M TPM | 75 RPS, 25M TPM |
| Tier 3 | $1,000 | 312 RPS, 74M TPM | 125 RPS, 45M TPM |
| Tier 4 | $5,000 | 500 RPS, 100M TPM | 208 RPS, 85M TPM |
| Enterprise | On request | Custom | Custom |
Only purchased credits and paid invoices count toward tiers. Exceeding a limit returns HTTP 429. Hitting rate limits doesn't cost money, but it does cost time and potentially users; the Batch API is one way around them, because batch requests don't count toward the limits.
Infrastructure Costs
Don't forget the costs outside per-token billing:
- File storage on xAI: $0.025 per GiB per day; collections storage $0.10 per GiB per day; downloads $0.20 per GiB
- Usage-guideline violations: requests blocked before generation on the Responses API cost $0.05 each, and blocked requests after generation are still charged
- Response logging: Compliance or debugging may require storing outputs
- Error handling: Failed requests consume tokens without producing results
A complete cost model includes these infrastructure considerations alongside API pricing.
Which Grok Model Should You Choose?
Selecting the right model requires balancing capability against cost. For model-by-model differences beyond price, see our comparison of current Grok text models.
Model Capability Overview
| Model | Context | Price (input / output per 1M) | Reasoning effort | Batch 20% | Rate limit at Tier 0 |
|---|---|---|---|---|---|
| grok-4.7 | 500K | $2.00 / $6.00 | low, medium, high (default), xhigh | Yes | 150 RPS |
| grok-4.6 | 500K | $2.00 / $6.00 | low, medium, high (default), xhigh | Yes | 150 RPS |
| grok-4.5 | 500K | $2.00 / $6.00 | low, medium, high (default) | Yes | 150 RPS |
| grok-4.3 | 1M | $1.25 / $2.50 | none, low, medium, high | Yes | 37 RPS |
| Grok 4.20 (reasoning, non-reasoning, multi-agent) | 1M | $1.25 / $2.50 | Reasoning or non-reasoning by model name | Yes | 37 RPS (multi-agent 9) |
| grok-build-0.1 | 256K | $1.00 / $2.00 | — | No | 37 RPS |
Use Case Recommendations
Customer Support Chatbots
- Recommended: grok-4.3 with "none" or "low" reasoning effort
- Reasoning: High volume, moderate complexity, cost-sensitive; output costs 58% less than on 4.7
- Alternative: Compare against GPT-6 Luna or Claude Haiku 5.5 if price per token decides
Code Review & Generation
- Recommended: grok-4.7, which xAI recommends for code; grok-build-0.1 for agentic coding at lower cost
- Reasoning: Code quality correlates with reasoning capability, and review work is output-heavy
- Alternative: Consider Claude Sonnet for safety-critical code
Document Analysis
- Recommended: grok-4.3 (1M context and Batch discount)
- Reasoning: Process long documents in one request, and run non-urgent jobs through Batch
- Alternative: Keep prompts under 200K tokens or the whole request bills at double rates
Research & Analysis
- Recommended: grok-4.7 with Web Search or X Search
- Reasoning: Complex reasoning and synthesis tasks require top-tier capability
- Alternative: Run the first pass on grok-4.3 and only the final synthesis on grok-4.7
Prototyping & Development
- Recommended: the free Console Playground, then grok-4.3
- Reasoning: Try prompts without spending credits, then measure costs on the cheaper model
- Alternative: Upgrade to grok-4.7 once you've validated the approach
Decision Tree
-
Do you need more than 500K tokens of context?
- Yes: grok-4.3 or a Grok 4.20 model (1M)
- No: Continue to step 2
-
Is cost the primary constraint?
- Yes: grok-4.3 with low or no reasoning, or grok-build-0.1 for coding
- No: Continue to step 3
-
Does your task require the strongest reasoning or coding?
- Yes: grok-4.7
- No: grok-4.3
-
Can the work wait up to 24 hours?
- Yes: send it through the Batch API for 20% off (not available for grok-build-0.1)
- No: standard requests, or Priority at 2× if latency matters
Model Mixing Strategy
Most production applications benefit from using multiple models:
- Routing layer: grok-4.3 with "none" reasoning for intent classification
- Standard queries: grok-4.3 for most requests
- Complex tasks: grok-4.7 for the share that needs deep reasoning
Worked example: 100,000 requests a month at 2,000 input and 500 output tokens cost $700 on grok-4.7 alone. Sending 80% of them to grok-4.3 and 20% to grok-4.7 costs $300 + $140 = $440, which is 37% less, while the hardest requests still get the flagship model.
Cost Optimization: Lowering Your Grok API Bill
Beyond model selection, several techniques reduce your Grok API costs. The savings below are calculated from xAI's list prices; your results depend on your traffic.
Prompt Caching
xAI caches prompt prefixes automatically, and cached tokens cost 75–85% less than standard input. To maximize cache hits:
- Standardize system prompts: Use identical system messages across requests
- Front-load static content: Place unchanging context at the prompt beginning, and never edit earlier messages in a conversation
- Set a conversation ID: send
x-grok-conv-id(orprompt_cache_keyon the Responses API) so related requests reach the same server
Example savings for a chatbot with a 2,000 token system prompt on grok-4.3:
- Without caching: 2,000 × $1.25/1M = $0.0025 per request
- With caching: 2,000 × $0.20/1M = $0.0004 per request
- 84% savings on system prompt tokens
Token Optimization
Reduce token consumption without sacrificing quality:
Input optimization:
- Remove unnecessary whitespace and formatting
- Use abbreviations in non-user-facing prompts
- Compress examples (fewer, more targeted examples)
- Truncate context to relevant portions, and keep prompts under 200K tokens
Output optimization:
- Specify maximum response lengths
- Request structured outputs (JSON uses fewer tokens)
- Lower the reasoning effort when the task doesn't need deep thinking
Output and reasoning tokens cost two to three times as much as input on every Grok model, so trimming output usually saves more than trimming prompts.
Batch Processing
For non-real-time workloads, use xAI's Batch API instead of calling the API one request at a time. Batch requests on grok-4.7, grok-4.6, grok-4.5, grok-4.3 and the Grok 4.20 models cost 20% less on every token type, most finish within 24 hours, and they don't count toward your rate limits. grok-build-0.1 is accepted without a discount.
# Instead of:
for item in items:
response = call_grok(item)
# Use:
batch_file = write_jsonl(items) # one request per line
batch = submit_batch(batch_file) # xAI Batch API
results = collect_results(batch) # usually within 24 hours, 20% cheaperBatching reduces:
- Token cost by 20% on the listed models
- Rate limit pressure
- Retry logic for large jobs
Response Caching
Cache responses for common queries:
cache = {}
def get_response(query):
cache_key = hash(query)
if cache_key in cache:
return cache[cache_key] # Free!
response = call_grok(query)
cache[cache_key] = response
return responseFor applications with repetitive queries (FAQ bots, standard analyses), every answer served from your own cache costs nothing on the API; how much you save depends on how often the same questions repeat.
API Aggregation Services
If you use several AI providers, an aggregation gateway can put them behind one key and one bill. laozhang.ai's public model list (updated November 13, 2026) includes grok-4.7, grok-4.6, grok-4.5, grok-4.3, the Grok 4.20 models and grok-build-0.1 at the same per-token prices as xAI's own list.
This approach particularly benefits teams that:
- Use multiple AI providers (Grok, OpenAI, Claude)
- Want simplified billing across providers
- Want to switch models without managing several accounts
- Prefer pay-as-you-go over monthly minimums
Cost Monitoring Best Practices
Implement these monitoring practices:
- Spending limits: Set auto top-up with a monthly maximum, and keep the invoiced billing limit at $0 if you want a hard stop
- Per-request cost: Log
usage.cost_in_usd_ticksfrom every response - Per-feature tracking: Identify which features and tools drive costs
- Regular audits: Review the console's Usage explorer weekly for optimization opportunities
Optimization Checklist
- Model names updated (no retired
grok-4-1-fast-*orgrok-3slugs) - Caching enabled and verified (
cached_tokensabove zero) - System prompts standardized
- Prompts kept under 200K tokens
- Batch API used for non-urgent work
- Response caching for common queries
- Tool calls and X Search result counts capped
- Rate limits understood and planned for
- Cost alerts configured
- Model selection matches task complexity
FAQ: Common Grok API Pricing Questions
How much does Grok API cost per token?
Grok API pricing varies by model. grok-4.7 costs $2.00 per million input tokens and $6.00 per million output tokens, which is $0.002 and $0.006 per 1K tokens. grok-4.3 costs $1.25 / $2.50 per million and grok-build-0.1 $1.00 / $2.00. Prompts of 200K tokens or more are billed at double rates. Prices checked November 14, 2026.
Is there a free tier for Grok API?
No. xAI publishes no free API tier or signup credit in November 2026. The $25 monthly beta credit ended with 2024, and the $150/month data-sharing credit ended in May 2025. The Console Playground is free for testing, and Grok for Startups, the X API spend rebate (10–20%) and promo codes are the remaining ways to get API credit.
How does Grok pricing compare to ChatGPT?
At the flagship tier, grok-4.7 ($2 / $6) and GPT-6.1 Sol ($2 / $10) charge the same for input, and Grok is cheaper for output; GPT-6.1 Sol has the cheaper cache ($0.10 against $0.50). At the budget tier, GPT-6 Luna ($0.10 / $0.50) is far cheaper per token than grok-4.3 ($1.25 / $2.50).
What is the largest context window available?
grok-4.3 and the Grok 4.20 models offer 1 million tokens; grok-4.7, grok-4.6 and grok-4.5 offer 500,000. The 2 million token window belonged to Grok 4.1 Fast and Grok 4 Fast, which were retired on May 15, 2026. On every model, prompts of 200K tokens or more are billed at double rates.
Do tool calls cost extra?
Yes. Web Search, Code Execution and attachment search cost $5 per 1,000 calls, Collections Search $2.50 per 1,000 calls, and X Search $5 per 1,000 posts and $10 per 1,000 profiles returned. These charges apply on top of the tokens the model uses while running the tools.
How do I claim the $150/month free credits?
You can't anymore. xAI ended the $150/month data-sharing credit program in May 2025, and the option no longer appears in the console. If your team joined before then, check credit grants under Billing in the console; for new teams, the current routes are Grok for Startups, the X API spend rebate and promo codes.
Can I use Grok API without an X Premium subscription?
Yes. Unlike the Grok chatbot, API access does not require X Premium or any Grok subscription. You need an xAI Console account and prepaid API credits (or approved monthly invoicing).
What happens when my free credits expire?
When your credit balance reaches zero and the invoiced billing limit is $0 (the default), xAI rejects API requests until you add credits or raise the limit. Grok for Startups credits expire six months after they are applied unless your approval says otherwise; unused credits are forfeited. Purchased credits are non-refundable.
Is there a minimum purchase or commitment?
No minimum commitment and no monthly fee: you buy prepaid credits and pay per token. Auto top-up has a $5 minimum per top-up. Monthly invoiced billing is available on request through sales.
How do cached tokens work?
When a request starts with the same tokens as a recent request, xAI can serve those tokens from cache and bill them at the cached rate: $0.50 instead of $2.00 per million on grok-4.7, $0.20 instead of $1.25 on grok-4.3. xAI publishes no fixed cache lifetime and says hits are not guaranteed; setting x-grok-conv-id or prompt_cache_key improves the hit rate.
Did xAI end the $150 data sharing program?
Yes. The program that paid $150 of API credits per month for sharing API data ended in May 2025; a developer account that tracks xAI reported the change on May 13, 2025, and no current xAI docs page mentions the program. Pages and AI answers that still describe it as available are out of date.
Does a SuperGrok or X subscription include API credits?
xAI doesn't document that. Its subscription docs say the weekly pool covers Grok Bot and Grok models across Grok and Cursor, while console API keys are billed per token from prepaid credits or invoices. Treat the API as a separate cost unless your own console shows otherwise.
What happened to Grok 4.1 Fast pricing?
Grok 4.1 Fast cost $0.20 / $0.50 per million tokens until xAI retired it on May 15, 2026. Requests to grok-4-1-fast-reasoning and grok-4-1-fast-non-reasoning now run on grok-4.3 and are billed at $1.25 / $2.50, so the same traffic costs about five to six times as much.
Is there a Grok API promo code?
xAI publishes no public promo code. The console's Billing page has a field for one, which is where codes from events, partners or xAI support are entered. Sites that list "Grok API promo codes" usually mean the expired $25 and $150 offers.
Conclusion: Getting Started with Grok API
xAI's Grok API in November 2026 is a straightforward pay-per-token service: $2 / $6 per million tokens for the flagship grok-4.7, $1.25 / $2.50 for grok-4.3 with its 1M context window, and $1 / $2 for the coding model grok-build-0.1. The free-credit era is over; the realistic ways to pay less are the Batch discount, prompt caching, the right model per task, and, if you qualify, Grok for Startups or the X API rebate.
For flagship work, grok-4.7's low output price makes it competitive with GPT-6.1 Sol, Claude Sonnet 5.5 and Gemini 4 Carbon. For the cheapest possible tokens, other providers' small models now undercut Grok's budget tier, so test quality before choosing on price.
Getting started takes five minutes:
- Create an account at console.x.ai
- Try your prompts in the free Playground
- Buy credits and set auto top-up with a monthly maximum
- Generate your API key and start with
grok-4.3 - Move the hardest tasks to
grok-4.7, and non-urgent jobs to the Batch API
The AI API landscape evolves rapidly, with pricing and capabilities shifting quarterly. Check the date at the top of this guide, and xAI's pricing page for the latest rates.
Additional Resources:
- xAI API pricing and rate limits
- Grok for Startups
- Free Grok API Access Guide
- API Aggregation Services
Whether you're building your first AI-powered feature or migrating from another provider, start in the Playground, measure the cost per request with cost_in_usd_ticks, and scale once the numbers work.






