Grok API pricing can look confusing because consumer subscriptions and developer API use have different bills. The API charges for tokens processed, with rates that vary by model, prompt length, and added tools.
Here’s how to tell those costs apart, estimate common workloads, and keep a long-running assistant from using more context than it needs.
Grok subscriptions and API usage are different pricing questions
A Grok subscription pays for direct access to Grok. API billing pays for model use inside software you build. One doesn’t automatically cover the other, so don’t treat a monthly chat plan as a credit balance for your app.
Consumer plans and bundles can change. Pricing summaries have shown free access alongside paid tiers such as $30, $100, and $200 monthly plans. Those figures describe subscription access, not a set number of API tokens. Check the current plan terms before buying, especially if you’re comparing a chat plan with a production workload.
The API is metered by usage. You send a request, the selected model processes its input, and the response uses output tokens. Each part has its own rate. If your app uses additional capabilities, check whether their pricing is separate from token rates.
This distinction matters when you’re building a bot or an always-on assistant. A subscription may suit a person using Grok directly. A developer needs to forecast request volume, token use, and any tool calls. If you’re weighing another provider for an assistant workflow, our Claude API overview explains the separate API-cost question for that model family.
SetupYourClaw is a self-serve way to deploy a personal OpenClaw assistant with preconfigured cloud hosting and a Telegram connection. It’s a separate setup option, not a Grok API subscription. If you use an API in any assistant workflow, budget its usage apart from hosting and deployment.
How token-based Grok API billing works
A token is a small unit of text the model processes. Input tokens include the prompt, system instructions, conversation history, and any added context. Output tokens include the answer and, for reasoning models, generated reasoning tokens.
Rates are usually shown per million tokens. To estimate a request, divide each token count by one million, multiply by that token type’s rate, then add the results. Input and output have different rates, so counting only your prompt won’t give you the full cost.
For a rough sense of scale, one English token is often around four characters or three quarters of a word. That’s only a rule of thumb. Code, uncommon words, and other languages can split into tokens differently. Your API response gives you the actual input and output counts.
Repeated prompt prefixes may be served from cache at a lower input rate. For Grok 4.7, the cited rate below the long-context threshold is $2 per million regular input tokens, $0.50 per million cached input tokens, and $6 per million output tokens. A cache discount applies only to input tokens that actually hit the cache.
One threshold has a large effect. Once a request reaches the long-context threshold, the higher rate applies to the full request, not only to tokens above the threshold. For Grok 4.7, that changes the rates to $4 per million input, $1 per million cached input, and $12 per million output.
That means a request just over the limit can cost much more than one just under it. If you send a long chat history on every turn, the prompt can grow even when the user’s new message is short. Summarize older turns or keep only relevant context when the task allows it.
Check the live rate details before you deploy, since model names and pricing can change.
For an everyday request, the useful habit is simple: inspect the usage counts returned with the response, then compare them with your estimate. A tokenizer estimate can miss added processing tokens, so actual response data is the better guide for a live budget.
How Grok API prices differ by model
Model choice affects both the rate and the kind of work the model is meant to handle. The prices below are per million tokens in USD, before any applicable context-based rate change or other charge.
- grok-4.7: $2 input, $0.50 cached input, and $6 output. It’s positioned for coding, agents, and knowledge work. Longer-context requests can have higher rates.
- grok-4.6: $2 input, $0.50 cached input, and $6 output at standard context length. It can suit existing agent deployments that already use it.
- grok-4.5: $2 input, $0.30 cached input, and $6 output. Its lower cached-input rate may suit workloads that reuse a large prompt prefix.
- grok-build-0.1: $1 input, $0.20 cached input, and $2 output. It’s described as a cost-efficient coding specialist.
- grok-4.3 and grok-4.20-multi-agent-0309: $1.25 input, $0.20 cached input, and $2.50 output. grok-4.3 is for general-purpose, cost-efficient reasoning, while grok-4.20-multi-agent-0309 is for multi-agent orchestration and long context.
These rates make model selection a workload decision, not a contest to pick the lowest number. A coding agent may be worth testing on grok-build-0.1. A long-context task may point you toward a model with a larger context window. For a high-stakes answer, test output quality before moving a task to a cheaper model.
Some older model aliases route to newer models, so an integration can keep working while its effective rate changes. Check the model ID your code sends and confirm the account’s current model list before assuming an older name still has its former price.
Pricing may vary based on the model and request. Check current account terms before estimating costs.
Compared with rates cited for flagship APIs from OpenAI and Anthropic, Grok’s lower-cost models can be less expensive per token. One current comparison gives $4 input and $20 output per million for GPT-5.6, versus $5 input and $25 output for Claude Opus 5. That rate comparison alone can’t tell you which model will complete your task well or how many tokens it will use.
What Grok API requests might cost in practice
The basic estimate is: input tokens times the input rate, plus output tokens times the output rate. Divide each token count by one million before multiplying. These examples use Grok 4.7 standard rates and assume each prompt stays below the applicable long-context threshold.
A short request
For a short request, estimate the input and output charges separately using their respective token counts and rates. Add the two amounts to get the model charge, before any tool fees.
A repeated prompt with cache hits
For a workflow with repeated prompts, compare the input cost without cache hits to the cost when some input tokens are cached. Cached input is charged at its applicable rate, so successful cache matches can lower the total; output costs are calculated separately.
That saving depends on the cache actually matching repeated prompt content. If each request changes most of its context, a cache discount may have little effect. Keep stable instructions together and check the cache-use counts in the response rather than assuming every repeated phrase qualifies.
A request that crosses the long-context threshold
For models with long-context pricing, the higher rates apply to the full request once the prompt reaches the applicable threshold. Estimate input and output costs at those rates, then add them together. A request below that threshold uses standard rates instead.
Tool use adds another line to the estimate. Web Search, X Search, code execution, or other tools may carry invocation or fetched-item fees. The model can also use more calls as a task gets harder. A request that asks an agent to search repeatedly should not be forecast as one plain text completion.
Use a cost-per-request estimate to build a monthly range. For example, multiply your average request cost by expected monthly requests. Then run the same calculation with a busier day’s token counts. The second number gives you a better sense of how much traffic spikes could change the bill.
If you’re setting up an always-on assistant, include the cost of repeated context in the estimate. SetupYourClaw handles deployment of a personal OpenClaw assistant in under one minute, with cloud hosting already configured and Telegram as the connection channel. API model use, where applicable, still needs its own usage budget.
What affects a Grok API bill beyond the model rate
The token rate is only one part of the bill. Request size, cache use, tool calls, processing tier, and region can all change what you pay. Track each separately so a rise in total spend has a clear cause.
Conversation history and context size
Many APIs don’t remember a conversation automatically between independent requests. If your app resends the full transcript every turn, that history counts as input again. A support assistant that carries every old exchange can grow its prompts until it reaches the higher long-context rate.
Keep the parts needed for the current task. A short summary can replace old turns, while a retrieval step can add only the relevant records. This also makes it easier to stay under the long-context threshold. Any memory or retrieval system has its own operating costs, so compare those with the token spend it avoids.
Tools, priority, and batch processing
Tool calls can add invocation charges on top of token use. X Search may be billed by returned posts or profiles rather than by a simple request count. Analysis of images and video can add token use even when a separate tool invocation charge doesn’t apply.
Requests that need higher scheduling priority may cost more when the response confirms priority service. For eligible text-model jobs, asynchronous processing may be available.
Region, credits, and spending limits
A regional endpoint may affect token rates for supported models. That may be relevant when you need regional processing, but a regional endpoint by itself is not a full statement of security or regulatory compliance. Confirm data handling terms against your own requirements, especially for a business or government workflow.
Billing can draw down prepaid credits, and monthly invoicing may be available by request. Set a spending limit where your account supports it, and decide what your application should do when the balance runs low. A graceful pause or a clear notice is safer than letting a background agent keep retrying without a bound.
The response can include a cost value that reflects token use and tool charges. Use that actual charge alongside the token totals in your own logs. It gives you a better record than estimating cost from request text alone.
SetupYourClaw is built for deploying an always-on personal assistant without managing cloud servers or configuring the runtime. If you’re planning a bot that stays available through Telegram, keep deployment and model usage as distinct budget lines so you can see which one changes.
How to estimate and manage Grok API spending
Build your estimate from observed usage, not a guess about how long a prompt looks. Start with one task and record its input, cached input, output, tool calls, and model ID. Then repeat the test with a typical prompt and a heavy prompt.
- Choose a model for the task. Test the lowest-cost model that can meet your quality needs. Keep the flagship for tasks where its output makes a clear difference.
- Measure a representative request. Use the API response’s token counts and cost value. Include reasoning tokens in output use when the model generates them.
- Multiply by expected volume. Apply the measured per-request cost to your expected daily or monthly request count. Add a separate allowance for tool calls.
- Test the edge case. Check what happens when prompts become much longer, when caching misses, or when traffic rises. For models with long-context pricing, a longer prompt can change the rate applied to the request.
- Set a cap and review it. Use account spending controls where available. Check usage by model and task so you can spot a chat history that keeps growing or a tool loop that runs too often.
For work with flexible timing, compare available billing options before choosing a service tier.
There’s no single enterprise or government rate to plug into every estimate. If you’re buying under a contract, ask for the exact model rates, tool charges, regional terms, billing method, and any volume discount in writing. For regulated work, have the security and data terms reviewed alongside the price sheet.
For an always-on assistant, run the estimate against actual conversation patterns. A brief Telegram exchange may use little context. A bot that retains long histories or searches documents can use far more. SetupYourClaw removes server setup and runtime configuration from OpenClaw deployment, but a model provider’s token charges remain a separate decision to track.
A useful budget is a range, not a promise. Keep a normal-use estimate and a high-use estimate, then set an alert or limit below the point where an unexpected run would cause trouble.
Frequently asked questions
Does a Grok subscription include API credits?
No, a Grok subscription and API usage are separate costs. The subscription provides access to its plan, while the API is billed according to the tokens and other billable features your application uses. Check the current terms for the plan you’re considering before treating it as part of an API budget.
How much does Grok API use cost per million tokens?
It depends on the model and token type. For example, Grok 4.7 is listed at $2 per million input tokens, $0.50 per million cached input tokens, and $6 per million output tokens at standard rates. Long-context pricing has higher rates for applicable requests.
Is there a free Grok API tier?
Some pricing summaries describe free consumer access or limited free testing options, but free chat access is not the same as free production API usage. Treat any credits or free allowance as a current account-specific offer. Confirm its amount, expiration, and eligible models before relying on it for development or ongoing traffic.
How does long-context pricing work?
For models with long-context pricing, higher rates may apply to the request. Check the applicable model’s rates before estimating costs. Summarizing earlier conversation turns or splitting a large task can help manage token use when the work allows it.
How can I lower my Grok API bill?
Measure actual token use first. Then test a less costly model, trim repeated conversation history, and check whether stable prompt prefixes receive cache hits. For non-urgent work, consider whether deferred processing is available. Track token use across workloads, since total API costs depend on the features your application uses.
Conclusion
Start with measured token use on the model that fits your task, then add tool fees and test long prompts before launch. Set a spending limit and review actual response costs after deployment. If you’re also planning a personal OpenClaw assistant, SetupYourClaw can handle its cloud setup and Telegram connection; confirm your model choice and API budget separately.
