All posts

Stop Optimizing the Wrong Variable

I've been watching xAI quietly build up to this. On July 8, they launched Grok 4.5 into developer access, then opened it to everyone on grok.com and t…

Server rack corridor with precise blue-green LED indicators active in a dark data center

I've been watching xAI quietly build up to this. On July 8, they launched Grok 4.5 into developer access, then opened it to everyone on grok.com and the X app the next day. They called it their "flagship model for coding, agentic tool calling, and knowledge work." That framing is deliberate. This isn't a general-purpose model with coding bolted on as an afterthought.

Most of the coverage led with the per-token price: $2 per million input tokens, $6 per million output. Competitive, but not shocking. The number that actually got my attention was 15,954. That's the average output token count Grok 4.5 uses to solve a task on SWE-Bench Pro. Claude Opus 4.8 uses roughly 67,020 tokens for comparable tasks on the same benchmark. A 4.2x difference.

When you're running agent loops at any meaningful scale, that gap is where your bill comes from.

Built for Agents, Tested Outside the Lab

xAI didn't just run evals and ship. Grok 4.5 went through internal validation at SpaceX and Tesla before the public launch. That's not a marketing detail to ignore. It means the model was put through actual engineering workflows before xAI was willing to call it production-ready.

The architecture decision that matters most for builders: it uses the OpenAI Chat Completions API format and also supports the newer Responses API. If you have code that calls GPT-4o or GPT-5.6 through the OpenAI Python SDK, swapping in Grok 4.5 is essentially a one-line change. Update base_url to xAI's endpoint, update the model name. Nothing else in your codebase breaks.

That's rare. Most model launches require you to at least think about migration overhead. This one doesn't.

The Token Efficiency Math

On raw coding accuracy, Grok 4.5 posts 64.7% on SWE-Bench Pro, with 83.3% on Terminal-Bench 2.1. Claude Fable 5 and Opus 4.8 beat it on accuracy. But the per-task cost picture looks very different once you bring in token counts:

Model SWE-Bench Pro Avg output tokens/task Output cost (standard)
Grok 4.5 64.7% 15,954 ~$0.096
Opus 4.8 higher ~67,020 ~$1.68

Opus 4.8 standard pricing is $25 per million output tokens. Grok 4.5 is $6. Multiply through by the token counts above and you get roughly a 17x difference in per-task output cost.

The caveat is important: Grok 4.5 resolves fewer tasks correctly, so "17x cheaper" isn't a clean apples-to-apples comparison. But for teams running coding agents at scale, the right question is: what's the cost per successfully resolved issue across a large batch? If Grok 4.5 clears 64.7% of tasks at $0.10 each and Opus 4.8 clears a higher percentage at $1.68 each, the economics can still strongly favor Grok 4.5 for most practical workloads.

I haven't run this at my own scale yet. These numbers are from xAI's published benchmarks. Your distribution of task difficulty will shift the calculation.

What You Actually Get in Production

The specs that matter for real agent builds:

  • 500K context window with a higher-context surcharge kicking in above 200K tokens
  • reasoning_effort parameter: low, medium, or high (high is default). Low skips extended chain-of-thought entirely. This is the cost lever you need for multi-step agent pipelines where not every step needs deep reasoning.
  • Prompt caching: 75% discount on cached input reads ($0.50/M vs $2/M). For agents that re-send the same system prompt and conversation context on every call, this changes the cost profile significantly.
  • Native tool calling, structured outputs, web search, X search, and code execution all supported.

What you don't get yet: EU availability. As of the July 8 launch, Grok 4.5 is not accessible in the EU through either the product or the API console. xAI says mid-July 2026 is the target. If your infrastructure requires EU-region processing or your users are primarily in Europe, factor that in.

How I'd Actually Route This

My read after going through the numbers: Grok 4.5 belongs in coding agent loops where you're running a high volume of tasks and per-task cost matters. The reasoning_effort parameter is exactly right for tuning that. Use low for routing and triage steps, medium for standard implementation tasks, high for the edge cases you actually need to think through carefully.

For tasks requiring the highest accuracy (complex architectural refactors, security-sensitive code, anything you'll scrutinize closely anyway), Fable 5 or Opus 4.8 still have the edge on correctness. But you probably don't need that accuracy tier for the majority of what a coding agent handles day-to-day.

The 500K context window at $2/M input also opens up something specific: agents that need to hold a substantial codebase in context without burning through budget in a day. That was genuinely hard to do economically before this.

The bigger shift this represents: model routing inside agent systems is becoming the main cost optimization. Not "which model do we use" but "which model, at which reasoning level, with how much caching, for this specific step in the pipeline." Grok 4.5 gives builders a new and reasonably priced point on that map. Whether it earns a permanent spot depends on how the accuracy gap closes over the next few months.

Sources: Grok 4.5 Developer Guide, BenchLM | xAI launch via Testing Catalog | Opus 4.8 pricing, Finout