A 3-step agent cost me $4.20. agenttrace showed me the O(n ) tool call hiding in plain sight.

Dev.to AI
Generative AI

I ran a small agent. Three steps. One web search, one summarize, one cite-check. I had budgeted maybe 12 cents. The bill at the end of the run was $4.20. I knew something was off but the per-call invoice line items were not telling me anything useful. They were just a list of messages.create calls. I needed to group them into the run that produced them and look at the cost shape. That is the gap agenttrace-rs fills. It is a Rust crate that aggregates LLM calls into runs and gives you cost, latency, and a by-model breakdown.