The fastest way to cut LLM spend in half is deleting unused context your agent never asked for
Whenever someone asks how to cut their LLM API bill, the conversation immediately jumps to model distillation, semantic caching, or downgrading to a smaller model.
Try this first: dump the exact messages[] + tools[] JSON payload of a normal production request to a file and read it top to bottom.
Almost every time I do this on a codebase, I find:
- 25 MCP tool definitions that are never used in that route, eating 6,000 tokens per turn.
- Verbose JSON responses from an earlier DB lookup where only
idandstatusmattered, sitting in history for 10 turns. - A 2,000-token "company style guide" injected even when the agent is just running a SQL check.
Trimming dead payload weight makes your current model faster, cheaper, and usually more accurate because it isn't wading through noise.