L

Learn AI

Track progress · learn offline

Open

Lesson 6 of 7

Cutting your inference bill

7 min read

Two teams run the same feature on the same model. One's bill is ten times the other's. Neither is doing anything clever — one just turned a few knobs the other didn't.

Cost is a formula, not a mystery

Whether you call an API or self-host, the bill comes from the same place: how many requests, how many tokens in and out of each, and how expensive the model is per token. That's a formula you can estimate up front — and every term in it is a lever. Change the model tier or the token counts and the bill moves in a way you can predict before you ship.

Your bill isn't a surprise at month-end. It's requests times tokens times price — estimate it first, then pull the term that's driving it.

The levers that actually move it

A few habits cut the bill hard. Right-size the model: use the smallest one that passes your quality bar, not the flagship by default. Trim tokens: shorter prompts and capped outputs cost less on every single call. Batch non-urgent work — batch processing trades speed for a lower rate. And cache: prompt caching reuses a repeated context instead of paying for it again. Stacked, these routinely cut a bill by most of its size.

The big wins are boring: a smaller model, fewer tokens, batching, and caching. None is clever — together they're the difference between a $100 and a $1,000 bill.

Measure before you optimise. Find which requests dominate your token count and fix those first — shaving a rare call saves nothing.

The shape of it

Your inference bill is too high. What's the highest-leverage first move?

Continue in the app

Take the whole Inference & Hardware course — tracked

Get your personalized path, progress and streaks in the app — this lesson and every next one, in order.