Complex · Where behavior comes from, and what it takes to run
The one number for spend
Spend counted per request hides waste, such as an agent looping. The number that matters is spend per order: everything spent to get one order right. That includes retries, searches and the share spent at the gateway. Measure it before and after each change, and keep the change only if it drops. Caps on steps and budgets at the gateway stop a loop early.
Example
Maple Mart, spend per order, in tokens before 9,400 for each order placed right after prompt caching and a search cap 5,100 one looping task, stopped at its cap counted in, not hidden
Try it Yourself
Spend per order was 9,400 tokens and is now 5,100. Keep the change? Type yes or no.
Exercise
Why count spend per order, not per request?