Strategy guide

LLM cost optimization: the techniques that actually move the needle

Five concrete levers for cutting AI API spend, and which workloads each one actually fits.

Most LLM cost optimization advice is vague — "use a cheaper model," "cache when you can." The techniques below are the ones with a specific, vendor-published discount attached, so you can size the savings before you build anything.

Prompt caching: up to a 90% discount on tokens you send repeatedly

Both OpenAI and Anthropic discount input tokens that repeat, prefix-for-prefix, across calls — a cache hit typically costs around a tenth of the standard input rate on their current model lineups. The catch is that caching applies to a matched prefix, not the whole prompt, so the win comes from structuring calls with the static part — system prompt, tool definitions, few-shot examples — first and identical across requests, and the variable, per-request content last. Anthropic charges a premium to write a new cache entry (roughly 1.25x a standard input token for its shorter default cache window, or 2x for its longer one) in exchange for that cheap re-read; OpenAI's caching has no separate write charge but requires the cacheable prefix to clear a minimum length, so very short prompts never qualify either way.

Batch APIs: 50% off anything that can wait a few hours

Both major vendors offer a batch endpoint at a flat 50% discount off synchronous pricing, on input and output tokens alike. Anthropic's typically returns results within about an hour and guarantees a same-day turnaround; OpenAI's guarantees within 24 hours, often faster. Neither supports streaming or is meant for anything user-facing in real time, which is exactly why the discount is worth it — evals, offline classification, bulk summarization, dataset backfills, and any job a human isn't waiting on synchronously are the natural fit. Routing that work off the synchronous path and onto batch is often the single largest cost cut available without touching a prompt or a model choice.

Reasoning and thinking tokens are billed as output — cap them

A reasoning model's internal reasoning tokens, and a thinking-enabled Claude model's extended-thinking tokens, don't appear in the visible response but are billed as output tokens — the more expensive half of every call, typically several times the per-token rate of input. Setting an explicit reasoning-effort or thinking-budget cap, or a hard max-output-tokens ceiling, bounds this directly. Without one, a harder-than-usual prompt can quietly reach for far more reasoning than the task needed and the bill reflects it, even though the final answer looks the same length as always.

Model routing: send easy requests to a cheap model

Every major vendor now ships a cost tier several times cheaper per token than its flagship model, built for exactly this: classification, extraction, short-form generation, and other tasks that don't need frontier reasoning. A simple router — even a rules-based one keyed on task type or input length, not a full ML classifier — that sends the easy majority of requests to the cheap tier and reserves the flagship model for the genuinely hard fraction usually cuts blended cost per request more than any single-model optimization can.

None of this works if you're optimizing against a stale price

Every discount above is a percentage off a base rate, and base rates move — vendors cut, raise, and restructure per-token pricing without always making noise about it. Optimizing hard against a rate that changed last month means your cost model is wrong by exactly however much that change was. That's the gap VendorSpies exists to close: verified current pricing for every tracked vendor, and a free watch so the next change reaches you before it silently breaks your cost assumptions.

See live, verified pricing and rate limits for every tracked AI vendor side by side on the vendor comparison tool, and add a free watch on the ones you rely on so the next price or rate-limit change reaches you before your invoice does.

Frequently asked questions