An agent loop resends an enormous amount of identical context on every step. The system prompt, the tool definitions, the project instructions, the files already read, all of it goes back in on step two, step three and step thirty.
Without caching, you pay full input price for that repetition every time, and it dominates your bill completely. With caching, the repeated prefix costs a fraction, and the economics of long agent sessions change from uncomfortable to routine.
Getting value from it requires structuring the prompt correctly: stable content first, system prompt, tool definitions, project context, and volatile content last. If something changes near the start of your prompt on every step, the cache never hits and you've built the expensive version by accident.
Check three things per provider: whether caching exists, what the minimum cacheable prefix length is, and how long entries live. A five-minute cache lifetime is fine for a continuous agent loop and useless for a user who wanders off mid-task.
This single optimisation typically matters more to your bill than which model you chose, which is why the pricing comparison on our LLM hub records cache read and write rates separately.