how-to

How to Reduce LLM Costs in 2026 - 6 Levers That Actually Move the Bill

Most LLM bills are 30 to 70 percent waste - the wrong model on easy calls, no caching, and bloated context. Here are the six levers that actually cut spend, in the order I pull them, plus the tools for each.

Published:

LLM bills sneak up on teams. The prototype cost pennies, then traffic grew, and now finance is asking why the model spend tripled. The good news: most of that bill is waste, and the waste falls into a handful of predictable buckets. I have cut production LLM costs by more than half without touching quality, and it came down to six levers.

The single most important rule: measure before you cut. You cannot optimize a bill you cannot see. Nearly every team I have worked with was surprised by which feature was actually expensive - it was rarely the one they assumed. So step one is always visibility, and the rest follows in order of impact.

Here are the six levers, in the order I pull them.

1. Measure cost per feature first

You need per-request cost tracking, broken down by feature, prompt, or user. Every LLM call has a token count and a price - an observability layer records that and rolls it up so you can find the expensive paths.

Langfuse is my default here. It tracks cost per trace, self-hosts free under MIT, and runs roughly 25x cheaper than LangSmith at high trace volume - so the tool watching your spend is not itself a big line item. It is framework-agnostic and maps the OpenTelemetry conventions, so it drops onto most stacks. If you already run a gateway, Portkey enriches OpenTelemetry traces with cost and token metrics right at the routing layer. Either way, you now have the map. Everything below depends on this step - do not skip it.

2. Right-size the model

This is the biggest single lever for most teams. Most apps run their most expensive model on every call, including the easy ones. Classification, extraction, short factual answers, formatting - these rarely need a frontier model. Route them to a smaller or cheaper one and you often cut spend by half on those paths with no measurable quality drop.

The clean way to do this is a gateway. Portkey routes to 1,600+ models through one API, with fallbacks and load balancing, so you can send easy requests to a cheap model and hard ones to the expensive model without rewiring your app. It is a drop-in proxy - point your existing OpenAI SDK base URL at it, no re-instrumentation. Use the cost data from step 1 to decide which routes to downgrade.

3. Cache repeated and similar calls

Caching is the most underused lever I see. Two kinds:

  • Exact-match caching returns a stored response for identical requests - zero tokens, zero cost.
  • Semantic caching returns a cached answer for requests that mean the same thing, even if worded differently.

For any app with repeated or overlapping queries - support bots, search, FAQ-style flows - caching can remove a large chunk of calls outright. Portkey builds caching into the request path alongside routing, so it is one config change rather than a service you build.

4. Trim the context you send

You pay per input token. Every retrieved chunk, few-shot example, and line of chat history is billed on every single call. Verbose RAG contexts and long agent histories are a quiet, compounding cost.

Practical trims: retrieve fewer, higher-quality chunks instead of top-20; shorten bloated system prompts; summarize old conversation turns instead of resending them raw. This is where the per-feature cost data from step 1 pays off again - it shows you which prompts are token-heavy so you know where trimming actually moves the bill.

5. Set budgets and rate limits

Cost control is not only about lowering the average - it is about capping the tail. A runaway agent loop or a scripted abuse spike can burn a month of budget in an afternoon. Set spend budgets and rate limits so a bad actor or a buggy loop cannot run the bill to the moon. Portkey includes budgets, rate limits and spend governance across all your providers in one control plane, which is the point of routing everything through a gateway in the first place.

6. Watch agent and RAG token bloat

Multi-step agents and RAG pipelines are the workloads that generate the most tokens - every reasoning step and every retrieved context adds up. These deserve their own attention because they scale fastest. Trace them (step 1), then attack the biggest offenders with routing, caching, and context trimming.

A word on Helicone

You will still see Helicone recommended as a cheap cost-tracking proxy, and it was a clean one - a proxy that logs requests and tracks cost with a base-URL change. But do not start on it fresh. Mintlify acquired Helicone on 3 March 2026 and put it in maintenance mode - security and bug fixes only, no roadmap, and Mintlify is actively helping customers migrate off. The proxy model also puts it in your request hot path, a single point of failure that adds latency (Helicone cites around 10ms). If you are already on it for cost tracking, use the runway to move to Langfuse. If you are evaluating fresh, skip it.

So where do you start?

  • You need to see where the money goes - Langfuse for cheap per-trace cost tracking, self-hosted or managed.
  • You need routing, caching and budgets in one place - Portkey as the gateway, though note real logs and analytics need its paid tier.
  • You are on Helicone today - plan your exit; it is frozen.

Pull the levers in order. Measure, right-size, cache, trim, cap, then chase the agents. The first two alone usually do most of the work. If you want a wider view of the observability side, the best LLM observability tools roundup covers the full field, and Portkey vs Langfuse digs into the gateway-versus-tracer split in detail.

Frequently Asked Questions

What is the fastest way to cut LLM costs?

Right-size the model. Most teams run their most expensive model on every call, including the easy ones. Routing simple requests - classification, extraction, short answers - to a cheaper or smaller model often cuts spend by half with no quality loss, because the hard model was never needed for those tasks. But you cannot do this safely until you can see cost per feature, so measurement comes first.

Does caching really reduce LLM costs?

Yes, and it is the most underused lever. Exact-match caching returns a saved response for identical requests at zero token cost. Semantic caching goes further - it returns a cached answer for requests that mean the same thing even if the wording differs. For any app with repeated or similar queries, caching can remove a large slice of calls entirely. An LLM gateway like Portkey builds both into the request path.

How do I know where my LLM spend is going?

You need per-request cost tracking tied to your traces. An observability tool records the token count and cost of every call, broken down by feature, user, or prompt, so you can find the expensive paths. Without this you are guessing. Langfuse tracks cost per trace and self-hosts free, and Portkey enriches OpenTelemetry traces with cost and token metrics at the gateway. Measure first, then cut.

Do longer context windows cost more?

Yes, directly. You pay per input token, so every chunk of retrieved context, every few-shot example, and every line of chat history you send is billed on every call. Verbose RAG contexts and long agent histories are a common hidden cost. Trimming context to what the model actually needs - fewer retrieved chunks, shorter system prompts, summarized history - cuts input tokens on every single request.

Explore More

Free Newsletter

Get the LLM Evals Newsletter

Platform comparisons, pricing changes and eval technique deep-dives. No spam.

Related Articles