PRICING · 7 MIN READ
Grok 4.5 API Pricing: The Real Cost of Agentic Workloads (And How to Cut It in Half)
xAI's new Grok 4.5 pricing looks affordable at $2 in / $6 out per million tokens, until you run it inside an agent loop. Here's the real cost math, and how to cut it in half.
Ravi Kumar
Co-founder ·
Grok 4.5 API Pricing: The Real Cost of Agentic Workloads (And How to Cut It in Half)
xAI shipped new pricing for Grok 4.5 this week: $2 per million input tokens, $0.50 per million cached input tokens, and $6 per million output tokens, with a 500k token context window. On paper that's a good rate card. In practice, if you're running Grok 4.5 inside an agent loop instead of a simple chat endpoint, your actual bill can be five to ten times higher than the rate card suggests, and most teams don't find that out until the invoice lands.
This post breaks down what Grok 4.5 actually costs, why agentic and tool-calling workloads multiply that cost so fast, and how routing your calls through Grokified cuts the effective price in half without changing a single line of application logic.
What Grok 4.5 Actually Costs
Here's the current xAI rate card for Grok 4.5, confirmed via xAI's official API pricing page and its developer docs:
| Token type | Price per 1M tokens |
|---|---|
| Input (uncached) | $2.00 |
| Input (cached) | $0.50 |
| Output | $6.00 |
Context window is 500k tokens, which is large enough to hold entire codebases, long support threads, or multi-document RAG context in a single call. That's the headline. The catch is that "per million tokens" pricing hides how many tokens a real workload actually consumes, and nowhere does that gap show up faster than in agentic use.
Why Your Bill Doesn't Look Like the Rate Card
A single chat completion is cheap. You send a prompt, get a response, done. Cost scales linearly with the length of that one exchange.
An agent is different. Most agent frameworks (tool-calling loops, coding agents, multi-step research agents) are stateless between calls. Every time the agent takes another step, that call has to include the full running transcript: the original task, every tool call it made, every tool result it got back, every intermediate reasoning turn. The model has no memory of the previous call unless you resend it.
That means input token count doesn't stay flat across a task. It grows with every turn, and you pay full input price on the entire growing transcript, every single turn, not just on the new tokens you added.
A Worked Example: A 40-Turn Agent Loop
Say you're running a coding agent that averages 40 tool-calling turns to complete one task (write code, run tests, read error, patch, re-run, repeat). Assume:
- Starting context (system prompt + task description): 3,000 tokens
- Each turn adds about 800 tokens to the running transcript (tool call + tool result)
- Each turn generates about 400 tokens of output
Total input tokens consumed across the task works out to roughly 744,000 tokens (the sum of a growing transcript resent on every one of the 40 turns), plus 16,000 tokens of output. At Grok 4.5's uncached rate, that's about $1.58 for one completed task.
Now scale that to a real weekend of agent usage: a team running 10 agents in parallel, each completing a task roughly every 10 minutes, non-stop for 48 hours. That's close to 2,900 completed tasks. At $1.58 per task, that's over $4,500 in API spend for one weekend, on a model whose rate card looks cheap. This isn't hypothetical. It's the exact pattern developers have been describing this week while discussing Grok 4.5 and other frontier models: agentic workflows "stack up quickly when every previous response is part of the next input," and teams have burned through thousands of dollars over a weekend without meaning to.
Prompt caching helps (cached input on Grok 4.5 is 75% cheaper than uncached), but only for the portion of the transcript that's an exact prefix match across calls, and only if your framework is actually structured to take advantage of it. Most agent loops aren't, out of the box.
How This Compares to Other Frontier Models
xAI itself has been drawing the comparison publicly this week, noting that Grok 4.5's $2/$6 per-million rate runs roughly 5x cheaper on input and around 8x cheaper on output than some competing frontier reasoning models. The exact numbers move around as providers reprice against each other (that repricing race is happening in real time right now), but the direction is consistent: Grok 4.5 sits meaningfully below the top of the market on a per-token basis while remaining competitive on reasoning and coding benchmarks.
That matters more in agentic contexts than in single-turn chat, because the multiplier effect described above applies to whatever base rate you're paying. A model that's 5x more expensive per token isn't 5x more expensive to run an agent on. It's 5x more expensive per turn, compounded across every turn in the loop.
Cutting the Bill in Half Without Touching Your Code
Grokified is a drop-in, OpenAI-compatible proxy in front of the xAI Grok API. You keep using the OpenAI SDK you already have. You change the base URL and the API key. That's it.
For the first $10,000 of usage, Grokified charges 50% off xAI's list price, capping your total savings at $5,000. After that threshold, it's 3% off for life. New accounts get $5 in free credits with no subscription required, and you can top up from $10 whenever you need more.
Here's the swap using the Python OpenAI SDK:
from openai import OpenAI
client = OpenAI(
base_url="https://api.grokified.com/v1",
api_key="YOUR_GROKIFIED_API_KEY",
)
response = client.chat.completions.create(
model="grok-4.5",
messages=[
{"role": "system", "content": "You are a precise coding assistant."},
{"role": "user", "content": "Refactor this function to handle null inputs."},
],
)
print(response.choices[0].message.content)
And the equivalent with curl, if you're calling the API directly instead of going through an SDK:
curl https://api.grokified.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_GROKIFIED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.5",
"messages": [
{"role": "user", "content": "Summarize this pull request diff."}
]
}'
That's the entire migration. No new client library, no changed request or response shapes, no rewritten agent framework. If your agent code is already built against the OpenAI Chat Completions format, which almost every framework (LangChain, LlamaIndex, custom tool-calling loops) supports natively, it works against Grokified immediately.
Run the 40-turn agent example from earlier through Grokified instead of xAI directly, and that $1.58-per-task cost drops to roughly $0.79 while usage is under the $10,000 threshold. Across the 2,900-task weekend scenario, that's the difference between $4,500 and $2,250, without touching your prompts, your tools, or your framework.
Practical Ways to Reduce Agentic Token Burn Further
Cutting the per-token price is half the fix. The other half is reducing how many tokens your agent actually consumes per task:
- Structure prompts for cache hits. Keep your system prompt and tool schemas as a stable prefix at the start of every call. Cached input tokens on Grok 4.5 cost a quarter of uncached input.
- Summarize or truncate old turns. Once a tool result has been acted on, you often don't need its full output in the transcript for the remaining turns. Compress it to a summary instead of carrying the raw payload forward.
- Cap turn count with a hard budget. Agents that don't converge in N turns usually aren't going to converge in 2N turns either. A hard cap prevents runaway loops from becoming runaway bills.
- Batch independent tool calls. If your agent framework supports parallel tool calls in a single turn instead of sequential round-trips, use it. Fewer round-trips means fewer times you pay for the full transcript.
None of this requires switching models. It requires knowing where your tokens are actually going, which is easier to see once your per-token cost is already cut in half.
FAQ
Does Grok 4.5 support prompt caching through Grokified? Yes. Caching behavior is passed through unchanged, since Grokified proxies requests directly to the underlying xAI API.
Do I need to change my request format to use Grokified? No. Grokified matches the OpenAI Chat Completions API shape. If your code already targets openai.com or another OpenAI-compatible provider, only the base URL and API key change.
Is there a subscription or minimum spend? No subscription. You top up your balance from $10 and spend it down. New accounts start with $5 in free credits.
Get Your API Key
If you're running Grok 4.5 in production, especially in anything agentic, the per-token rate is the lever with the biggest immediate impact on your bill. Sign up at grokified.com, grab your API key, and swap one line in your client config. Your first $10,000 of usage runs at 50% off xAI's list price, up to $5,000 in savings, and you start with $5 in free credits to test it against your own workload today.
Ravi Kumar
Co-founder, Grokified
Previously built billing infrastructure for two developer platforms. Writes about the unglamorous parts of running an API business.
