Cost · · 3 min read
Agent spend, before the invoice
Agent spend accrues in thousands of small calls attributed to keys, not agents, until the invoice adds it all up for the first time. A usable floor reports it daily, by agent, with the gaps shown as gaps.
A team running seventeen agents in production described their spend visibility to Hacker News in one line: "The UI for all of that spending was our credit card statement. Once a month. After the fact." (HN) That team had seventeen agents already built and shipped to production — the competence wasn't in question. What had no owner was the number between an agent running and what it cost, so it surfaced wherever charges got added up first.
Why the default is invoice lag#
Agent spend doesn't arrive as a bill. It arrives as thousands of individual token charges, spread across however many model calls an agent makes to finish one task, often split across more than one provider because a routing layer picked whichever model looked cheapest or fastest for that step. A single task might take a handful of calls or a few hundred, depending on how many tool uses and retries it needs before it's done. Each charge is billed to an API key, and a key is commonly shared across every agent a team runs — so the provider's usage page shows key-level totals with no per-agent breakdown. Somebody has to build the join between key and agent before the number means anything. Until someone does, the invoice is the first place all those charges get summed into a total a human can read, because it's the only aggregation that happens automatically.
The small-scale version of the same gap showed up in a Show HN: a founder left an agent running, walked away for twenty minutes, and came back to a bill he didn't expect — thirty-two dollars. Twenty minutes is short next to a monthly statement, but nothing about the setup guaranteed a twenty-minute window. It was twenty minutes because that's when someone happened to check.
What the floor should look like#
A usable floor has three parts.
First: month-to-date dollars and tokens broken out by agent, not by API key, visible at any hour of any day. If a key is shared, the runtime has to attribute each call to the run that made it at the moment the call happens. A dashboard that reports only at the key level hasn't closed the gap; it has just made the invoice arrive on a shorter loop.
Second: a projection to month end, built from the trend so far. "On pace for $4,200 this month" is a number someone can act on before the 30th arrives; a running total with no trendline only tells you what already happened.
Third: an honest account of the runs that produced no usable cost evidence. A call can fail before the provider logs usage; a retry can duplicate a charge; a proxy can drop the token count. When one of those happens, show a flagged gap. Dropping the run from the total silently, or averaging it in as if it cost nothing, is how a team ends up with a dashboard installed and still unable to say what a run cost when asked.
Spend as its own approval class#
Past a threshold your team sets, a spend event deserves the same treatment as a production write: it waits for a human to see it before it executes. That's the same negative-lag reasoning that applies to a database delete, applied to a dollar figure. A four-figure anomaly discovered on day thirty is a line item nobody can explain later. Caught before it clears, it's something someone can just ask about.
Ask your team this week what agent X cost yesterday. There are two acceptable answers: a number, or a flagged gap that names which runs it couldn't account for. The answer to fix first is the one that's a date next month.