AI Tools Hub
Workflow· 1 min

Seven ways to cut LLM API costs, in order of effect

When the bill surprises you, work down this list rather than starting at the bottom.

AI Tools Hub Editorial · published · updated

In order

MeasureEffectEffort
1. Use prompt cachingLargeLow
2. Shorten the inputLargeMedium
3. Different models per taskLargeMedium
4. Cache repeated queries in your appMedium–largeMedium
5. Move work to batch APIsMediumLow
6. Cap output lengthMediumLow
7. Switch everything to a cheaper modelMediumHigh — needs quality testing
Starting at 7 means quality drops and you revert.

Caching needs the prefix stable

Prompt caching only works when the cached portion is at the start of the request and matches exactly. Implementations that put user input early defeat it. Reorder before concluding caching does not help.

Shorter inputs, same quality

If RAG passes twenty chunks, try five. Quality usually holds, because beyond a point extra chunks add noise rather than context. Conversation history is the other common waste — send the recent turns plus a summary instead of everything.

Build an evaluation set before step 7

Twenty to thirty representative inputs with expected outputs, run against both models. It takes an afternoon and turns every future model decision into a measurement rather than a guess.

FAQ

Where do I start?

Measure first. Per-task token counts almost always show one operation consuming most of the budget, and fixing that one is usually enough.

Related

More articles