AI Cost Optimization: Stop Overpaying for Every Token

·6 min read·Ervandra Halim

Key answer

Not every task needs the expensive model: the answer is to route by complexity across light, daily, and deep model tiers, cache repeated context instead of re-sending it, batch anything that doesn't need an instant answer, and measure cost per completed task instead of cost per call. Ervandra Halim has seen this combination cut monthly AI spend by more than half without any drop in output quality.

  • Combining tiered model routing, prompt caching, batching, and cost-per-task measurement can cut monthly AI spend by more than half without reducing output quality.
  • Routing 70-80% of requests to light or daily tier models and reserving the top-tier model for only the hardest 20-30% is often the single biggest cost lever.
  • Prompt caching only pays off if stable, repeated context is structured to come first and variable per-request content last, since caching works on prefix matching.

Most businesses I talk to about their AI spend are using one model for everything, usually the most capable one available, because it's the default and nobody's gone back to question it. AI cost optimization is not about using AI less. It's about matching the tool to the task, the same discipline you'd apply to staffing: you don't put your most senior, most expensive engineer on ticket triage, and you shouldn't put your most expensive model on tasks that don't need that level of reasoning.

I've seen companies cut their monthly AI bill by more than half without any drop in output quality, simply by restructuring how requests get routed and how much repeated context gets sent on every single call. None of this requires switching providers or negotiating a better rate. It's architecture, not procurement.

Here's what that actually looks like in practice.

Does Every Task Need the Expensive Model?

Not every task needs the expensive model: task complexity, not habit, should decide which model handles a request. Every major model provider offers a range of models at different price points, roughly correlated with capability and reasoning depth, yet most teams send every request, from summarizing an email to designing a database migration strategy, through the same top-tier model.

A practical three-tier setup:

  • Light tier: classification, simple extraction, formatting, short summaries, and any task with a narrow, well-defined output. These tasks rarely need deep reasoning and a cheaper, faster model handles them at a fraction of the cost with equivalent accuracy.
  • Daily tier: drafting content, answering routine customer questions, standard code generation, moderate-complexity analysis. This is where most day-to-day business usage actually sits.
  • Deep tier: multi-step reasoning, complex debugging, architecture decisions, anything where a wrong answer is expensive to unwind. Reserve your most capable, most expensive model for genuinely hard problems.

The router logic doesn't need to be sophisticated. Even a simple rule set, "if this is a classification task route to light tier, if it involves multi-step planning route to deep tier," captures most of the savings. I've set this up for internal tools where 70-80% of requests land in the light or daily tier, and only the remaining 20-30% actually need the expensive model. That alone is often the single biggest lever in AI cost optimization for a business running any volume of requests.

You don't put your most senior, most expensive engineer on ticket triage, and you shouldn't put your most expensive model on tasks that don't need that level of reasoning, says Ervandra Halim, CPTO and principal architect.

How Do You Stop Re-Sending the Same Context?

Prompt caching stops the re-send: repeated context such as a long system prompt, a knowledge base excerpt, or a document gets processed once and reused at a steep discount on subsequent calls within a time window, instead of being re-processed on every single request your application sends.

This matters enormously for:

  • Customer support tools that reference the same product documentation on every ticket.
  • Document analysis workflows where the same contract or report gets queried multiple times with different questions.
  • Coding assistants that keep the same codebase context loaded across a session.

In practice, caching can cut the cost of the "context" portion of a request by 80-90% on repeat calls. If your context is large relative to the actual question being asked, which is common, this is often a bigger saving than model routing alone. The catch is you have to structure your prompts so the stable, repeated part comes first and the variable, per-request part comes last, since caching works on prefix matching. A lot of teams miss this saving simply because their prompt structure interleaves static and dynamic content instead of separating them cleanly.

Batching: Group What Doesn't Need an Instant Answer

Real-time responses are expensive relative to batch processing, because batch APIs (where supported) can run at a meaningful discount in exchange for not needing an immediate response. Anything that doesn't need to return in seconds is a candidate:

  • Nightly report generation
  • Bulk content tagging or categorization
  • Overnight data cleaning or enrichment jobs
  • Scheduled summary digests

If your business runs any of these as real-time calls purely out of habit, moving them to a batch job is close to free money. Nobody is waiting on the other end for a report that gets read the next morning anyway.

Why Measure Cost Per Completed Task Instead of Cost Per Call?

Cost per completed task matters more than cost per call because a cheap call that fails and needs three retries ends up more expensive than one well-structured call to a pricier model that succeeds on the first attempt. This mindset shift is the one most companies skip.

Track cost per completed task instead: how much did it actually cost, in total tokens across all retries and follow-up calls, to get a task fully and correctly done. This reframing often reveals that:

  • A cheap model that hallucinates on complex tasks and needs manual correction is more expensive in total than a pricier model that gets it right immediately.
  • A poorly structured prompt that needs three follow-up clarifications costs more than a well-structured one-shot prompt to a slightly pricier model.
  • Automating a task badly, requiring human review and rework every time, can cost more in labor than doing it manually was costing before.
Optimization Typical savings Effort to implement
Tiered model routing 30-50% Low to moderate
Prompt caching for repeated context 10-30% additional Low
Batch processing for non-urgent tasks Varies, often 50%+ on those tasks Low
Measuring cost per completed task Reveals hidden waste, no direct % Moderate (requires tracking)

Combined, these four changes are where the "50%+ without losing quality" number actually comes from in practice, not from any single trick but from the compounding effect of applying all four.

Where This Fits Into a Bigger AI Strategy

Cost optimization only matters if the underlying approach is right in the first place. If you're still deciding whether your business needs a custom fine-tuned model or whether prompting a general model is enough, that decision affects your cost structure far more than any routing tweak will; see Fine-Tuning vs Prompting: What SMEs Actually Need before you invest further in either direction. And if AI usage in your business still feels bolted onto old manual processes rather than built into the workflow itself, the inefficiency is often structural, not a pricing problem at all, worth reading in AI-Native Workflows vs Bolting AI Onto Old Processes.

The Takeaway

Most AI overspend isn't a pricing problem, it's an architecture problem: one model doing every job, the same context re-sent on every call, and real-time processing used where batch would do. Route by task complexity, cache what repeats, batch what can wait, and measure cost per completed task instead of cost per call. Do those four things and the bill drops without anyone noticing a change in quality, because there isn't one.

ai cost optimizationllm pricingmodel routingbudgetefficiency

Frequently asked questions

Does routing simple tasks to cheaper models hurt output quality?

No, not when tasks are classified correctly. Light-tier models handle narrow, well-defined work such as classification, extraction, and formatting at equivalent accuracy for a fraction of the cost; quality problems come from routing genuinely hard, multi-step reasoning tasks to a model too weak to handle them, not from tiering itself.

Do we need to switch AI providers or negotiate a better rate to see these savings?

No. The savings described here come from restructuring how requests get routed and how repeated context gets sent, not from procurement. None of the four changes, tiered routing, prompt caching, batching, or measuring cost per completed task, requires a new vendor or a renegotiated contract.

Why isn't our prompt caching saving as much as expected?

Usually because the prompt structure interleaves static and dynamic content instead of separating them. Caching works on prefix matching, so the stable, repeated part of a prompt, like a system prompt or knowledge base excerpt, needs to come first and the variable per-request part needs to come last for the discount to apply.

Which tasks should move from real-time calls to batch processing?

Anything that doesn't need to return in seconds: nightly report generation, bulk content tagging, overnight data cleaning or enrichment, and scheduled summary digests. If a business runs these as real-time calls purely out of habit, moving them to a batch job is close to free savings since nobody is waiting on the output anyway.

Ervandra Halim

Ervandra Halim

CPTO & Principal Architect

Ervandra Halim helps owners and leaders modernize operations and put AI to work daily. He partners with a few businesses at a time, mostly by referral.

Keep reading

AI & Automation

Automating Your Back Office With AI Workflows

A step-by-step guide to back office automation with AI: which admin tasks to automate first, how to chain workflows, and how to keep humans in control.

·6 min read

© 2011–2026 Ervandra Halim