Grok API Pricing: Grok 4.5 Cost Calculator
Grok API pricing for grok-4.5, with the 200K long-context trap, cached token rates, tool call costs, and a live calculator for your agent workflow.
Table of Contents
Grok API pricing for grok-4.5 is $2.00 per million input tokens, $0.30 per million cached input tokens, and $6.00 per million output tokens, until your prompt reaches 200K tokens and every one of those rates doubles. That threshold, not the headline rate, is what decides most agent bills, and xAI's published pricing puts the long-context tier at $4.00 input, $0.60 cached, and $12.00 output per million.
Key takeaways:
- Grok API pricing has two tiers, and the switch happens at 200K prompt tokens, counting cached tokens.
- Server-side tools cost $5 per 1,000 calls on top of tokens, so a tool-heavy agent is not priced by tokens alone.
- Priority processing doubles token rates again, which stacks with the long-context tier.
- Retries are the quiet line item: each one repeats the full token cost of the run.
- Estimate the workflow, not the prompt. The calculator below models tiers, caching, tools, and retries together.
Vera here. I have watched agent budgets drift for a boring reason: the team priced one clean prompt, then shipped a messy workflow. The real bill came from retries, repeated source packets, and a context window that quietly crossed a threshold nobody was watching. Grok API pricing rewards teams who estimate the shape of the work, not the shape of one request.
Grok API Pricing at a Glance

xAI lists grok-4.5 with a 500K context window, text and image input, function calling, structured outputs, and reasoning on its model card, plus web search, X search, and code execution as server-side tools in the models overview.
| Grok API pricing tier | Input | Cached input | Output |
|---|---|---|---|
| Under 200K prompt tokens | $2.00 / 1M | $0.30 / 1M | $6.00 / 1M |
| 200K+ prompt tokens | $4.00 / 1M | $0.60 / 1M | $12.00 / 1M |
| Priority processing | 2x served tier | 2x served tier | 2x served tier |
| Server-side tools | $5 per 1,000 calls |
Rates were verified against xAI's docs on July 29, 2026. Prices change, so check the source before you commit a budget.
The price per token is tiny in isolation. Agent workflows are not isolated. A research agent reads the same sources, calls tools, drafts, revises, and summarizes its own logs, and every pass bills again.
What this resolved: the rate card, including the tool and priority lines most summaries leave out. What it left unsolved: which of these lines your workflow actually triggers.
Calculate Your Grok API Cost
Move the sliders to match one run of your workflow. The tier badge flips automatically when fresh plus cached input crosses 200K, and the note under the monthly figure tells you what that crossing costs.
The defaults describe a mid-sized research run: 60K fresh input, 100K cached, 20K output, and three tool calls. That is about $0.29 per run, or $142.50 a month at 500 runs.
Now push cached input from 100K to 150K. Nothing about the job changed in any way a person would notice, but total prompt tokens hit 210K, the long-context tier engages, and the same workflow costs $292.50 a month. A 50K increase in reused context roughly doubled the bill, because the tier applies to every token in the request, not just the ones past the line.
What this resolved: a per-run and per-month number you can put in a budget request. What it left unsolved: whether your cache actually hits, which is the next section.
The 200K Threshold Is the Biggest Line Item
The 200K prompt-token threshold is the first thing to watch, and the detail that catches people is that cached tokens count toward it. A prompt is not "small" because most of it is cheap.
Say you run a weekly competitive brief. The instructions and the source packet are stable at 150K tokens, and each week you add roughly 40K of new material. At 190K you are paying $0.30 per million on the cached bulk. Add two more competitors, cross 200K, and that same cached bulk bills at $0.60 while your fresh input and output rates double alongside it. The cost step is not proportional to the extra work.
Splitting the job usually beats paying the tier. Source inventory, extraction, then synthesis as three requests under the threshold will often cost less than one request above it, and each step is easier to cache and to debug. The tradeoff is orchestration complexity and more round trips, so it is worth measuring rather than assuming.
What this resolved: the threshold counts cached tokens, and crossing it reprices the whole request. What it left unsolved: splitting adds orchestration overhead that your own workflow has to justify.
Caching Is the Second Lever, and It Is Not Guaranteed

Cached input at $0.30 per million is an 85% discount on the standard input rate. xAI routes caching through a stable key, prompt_cache_key on the Responses API or x-grok-conv-id on Chat Completions, and reports what actually hit in the cached_tokens usage field.
Do not forecast that discount as guaranteed. Cache hits depend on a stable prefix, consistent routing, and eviction timing, and any edit early in the prompt invalidates everything after it. A budget worksheet needs two scenarios: one where the cache behaves, and one where it does not.
The calculator makes that gap concrete. With the default settings, a full cache miss moves the run from $0.29 to $0.46, a 59% increase from a single infrastructure detail that never appears on a rate card. Track cached_tokens per run from the first day, not after the first surprising invoice.
What this resolved: caching is the largest available discount and the least reliable one. What it left unsolved: your real hit rate, which only production traffic reveals.
Tool Calls and Retries Are Billed Outside the Token Rate
Two line items sit outside the token math entirely.
Server-side tools bill at $5 per 1,000 calls, which reads as negligible and behaves differently at agent scale. A monitoring agent making 40 tool calls per run, 20 times a day, burns 800 calls daily: $4 a day, about $1,460 a year, on invocations alone before a single token is billed. Worse, tool results come back as input tokens on the next turn, so a chatty tool inflates both lines at once.
Retries are the line item nobody budgets. A retry is not a discount on a failed run, it is a second full run: input, output, tools, all of it. Set retries to 2 in the calculator and the default workflow goes from $142.50 to $427.50 a month. If your agent silently retries on malformed output, your effective rate card is triple what you approved.
What this resolved: tools and retries are multipliers on top of tokens, not rounding errors. What it left unsolved: how often your agent actually retries, which you only learn by logging it.
Grok API Pricing vs Claude: Where the Comparison Actually Lands

On headline rates, Grok 4.5 is cheaper than every current Claude tier on output. Anthropic's pricing lists Claude Sonnet 5 at $2 input and $10 output during introductory pricing through August 31, 2026, then $3 and $15. Claude Opus 5, released July 24, 2026, is listed at $5 and $25, matching Opus 4.8. Fable 5 is $10 and $50.
| Model | Input / 1M | Output / 1M |
|---|---|---|
| Grok 4.5, short context | $2.00 | $6.00 |
| Grok 4.5, 200K+ context | $4.00 | $12.00 |
| Claude Sonnet 5, intro | $2.00 | $10.00 |
| Claude Opus 5 | $5.00 | $25.00 |
| Claude Fable 5 | $10.00 | $50.00 |
Headline rates are the least interesting part of this comparison. Token efficiency, retry rates, and how often each model needs a second pass move the effective number far more, and Claude prices its 1M context window at standard rates rather than stepping up at a threshold. We work through the benchmark and effective-cost side of that in Grok 4.5 vs Claude.
What this resolved: Grok 4.5 wins the rate card on output, clearly. What it left unsolved: rate cards do not pay invoices, and neither model's effective cost is knowable without running your own traffic.
Budget Guardrails for Agent Workflows

Agent budgets need caps before they need production traffic. The risk is rarely one expensive call. It is a loop that keeps expanding context, calling tools, and rewriting output with no stop condition.
A workable plan defines seven things: monthly spend cap, per-task estimate, alert threshold, fallback model, retry limit, long-context rule, and the person who approves an increase. If a workflow exceeds its estimate by 30% twice in a row, pause it and look for the usual suspects: cache misses, oversized context, unbounded tool calls, or instructions vague enough that the model keeps trying again.
Store every run with model ID, context tier, input tokens, cached tokens, output tokens, tool calls, retries, final cost, and reviewer decision. That record turns cost control from argument into arithmetic. Recurring workflows are where this matters most, because they combine browser work, files, reports, and delivery checks that each affect the forecast. If you are mapping that out, AI workflow automation and build an AI agent cover the task, tool, and review structure that sits underneath the cost model.
What this resolved: a guardrail checklist and a run-level record to enforce it. What it left unsolved: guardrails catch overspend, they do not tell you whether the output was worth it.
FAQ
What is the Grok API price per token?
For grok-4.5, $2.00 per million input tokens, $0.30 per million cached input, and $6.00 per million output under 200K prompt tokens. At 200K and above, those become $4.00, $0.60, and $12.00. Priority processing doubles whichever tier served the request.
Do cached tokens count toward the 200K threshold?
Yes. The tier is set by total prompt tokens, and cached tokens are part of the prompt. A request that is mostly cheap cached context can still trigger long-context pricing for every token in it.
How much do Grok tool calls cost?
Server-side tools, including web search, X search, and code execution, bill at $5 per 1,000 calls, separate from tokens. Tool results also return as input tokens on the following turn, so a tool-heavy agent pays twice for the same activity.
Is Grok 4.5 cheaper than Claude?
On published rates, yes, on output for every current Claude tier. Effective cost depends on token efficiency, retries, cache behavior, and whether the model finishes without manual repair, so run both on your own workflow before switching a default.
When should a workflow pause for budget review?
When a run unexpectedly crosses the long-context threshold, cache hits fall to zero, tool calls spike, priority processing gets used by accident, or reviewer revisions double the expected passes. Review before the workflow becomes routine, not after.
Can old prompts forecast future cost?
Only if they logged token counts, tool calls, and retry history. Prompt length alone is misleading: a short prompt that triggers large tool results can cost more than a long, stable source packet with a good cache hit rate.
Grok API Pricing Rewards Workflow Estimates, Not Rate Cards
Grok API pricing is genuinely aggressive on the rate card, especially for output-heavy work. The number you actually pay depends on the context tier, whether the cache holds, how many tools each run invokes, how often the agent retries, and how many review passes a human demands before the output ships.
A calculator that only multiplies tokens will underestimate all five. Model the workflow: where it repeats context, when it crosses 200K, what a tool call really triggers, and at what point a person should stop the spend before the automation keeps going without them.
Rates and model availability in this article were verified against primary sources at xAI and Anthropic on July 29, 2026. Pricing in this market moves quickly, so check the linked sources before making production decisions.
Continue Reading
More GuideThe MoClaw editorial team writes about workflow automation, AI agents, and the tools we build. Default byline for industry overviews, listicles, and collaborative pieces.
Ready to put this into practice?
MoClaw runs browser tasks, research, and schedules automatically. Try it free.
References: xAI developer pricing · xAI grok-4.5 model card · xAI models overview · xAI prompt caching usage and pricing · Anthropic Claude pricing · Introducing Claude Opus 5