Cost per Deliverable: Attributing Agent Spend to Shipped Work
Every harness can tell you what you spent. Token counts, dollars per day, a chart that goes up and to the right. None of them can tell you what that spend shipped. Did the forty dollars your agent burned yesterday turn into a merged pull request, or did it thrash around in your repo for three hours and leave you a branch you deleted?
In July we wrote about keeping our own AI costs under a penny per conversation. This post is about the other side of the ledger: measuring what your agents cost against what they deliver. That number is much harder to get right than the token meter, and almost every naive way of computing it produces a figure that looks perfectly plausible and is quietly wrong.
The conversation is the atom
The first decision was the unit. Spend has to attach to something, and the something has to be real work. We settled on the conversation as the atom of cost. Every token is billed to a conversation, and conversations roll up into work items: a ticket, a pull request, a sprint. We never split cost below a conversation, because any finer split would be a guess dressed up as a measurement.
The second decision was the denominator. Cost gets divided by outcomes, never by time. If one engineer's agent ships the same work for a third of the spend, that's useful for the whole team to know. If someone takes two days off, that's nobody's business. A cost-per-hour view of an engineer is surveillance with a dashboard. A cost-per-deliverable view of a configuration is engineering data. We built the second and refused to build the first.
Two ways in
Spend data reaches us by two routes, each chosen for what it does best.
The first is a forward proxy. If you bring your own API key, your agent's traffic can pass through a small local proxy that reads token counts straight off the provider's billed responses. That's wire data — the closest thing to ground truth available without reading your invoice.
The second covers everything the proxy can't reach. Subscription-authenticated clients don't route cleanly through a custom base URL, so for those we ingest the client's own OpenTelemetry export. Claude Code can emit usage telemetry for either auth mode through one channel, and it's the richest source of per-agent identity available. Its dollar figures are computed on the client, so they're estimates by construction — and labeled that way.
We keep it to two routes on purpose. Every additional channel reporting the same spend is one more opportunity to count it twice.
Counting every call once
Two routes means the same call can arrive from both directions. If each route invents its own identifier for a call, anyone running both gets doubled tokens and doubled dollars, and nothing about either row looks wrong in isolation.
So we don't invent identity. Both routes key on the per-call request id that comes back from the model provider. When the same call arrives twice, the proxy's row upgrades the telemetry row in place: measured token counts replace estimated ones, and the call becomes eligible for the exact label. The upgrade keeps the telemetry row's agent identity, because trading a double count for a lost attribution isn't a fix. One call, one row, the best data from each source.
A practical note for anyone building something similar: before you key on a field, go count how often it's actually populated in real traffic. Documentation and reality don't always agree, and the data is the only one that's authoritative.
Which agent spent it
The newest models lean hard on subagents. One orchestrator fans out to five workers, each picking up a different ticket. That's where most attribution schemes quietly fall apart.
Agents in Systimus declare what they're working on as part of their behavioral loop. The obvious design stores one active declaration per user. Run five subagents on five tickets under that design and every one of them resolves to whichever declaration was written last. One ticket looks expensive, four look free, and the total still adds up — so nothing alerts you that the breakdown is fiction.
We give each agent its own declaration, resolved in tiers: the agent's own claim first, then the nearest ancestor that declared something, then the user. And we record which tier answered. An agent saying "I'm working on this ticket" is a stronger claim than inheriting that from its orchestrator, and the data remembers the difference. When a client doesn't report agent identity at all, attribution happens at the user level. We never infer an agent we can't see.
Which work item
Pulling ticket references out of text isn't the hard part. False positives are. "UTF-8-encoding-fix," "RFC-7231-compliance," and a CVE identifier are all well-formed ticket keys, and none of them are tickets. So references are validated against the projects that actually exist in your tracker. Nothing guesses.
Timing matters too. An event only gets tagged with a work item if the declaration came before it. If an agent declares a ticket halfway through a session, the spend before that point isn't retroactively assigned. It falls back to the nearest conversation by time instead.
And spend that can't be attributed doesn't disappear. It shows up as unattributed, with a coverage figure next to it. Dropping it would make a partial rollup look complete, and a total that silently excludes the hard cases is a total nobody should trust.
Exact, estimated, API-equivalent
Every dollar figure we show carries a label, and the labeling rule is the most important design decision in the system.
The order of trust is fixed: wire data from the proxy, then hints reported by the client, then estimates. A figure is labeled exact only when it's backed by proxy-correlated wire data. Everything else is labeled estimated. Estimation is never silent.
Subscription usage gets a third treatment. If you're on a flat-rate plan, the dollars we compute are rack-rate equivalents — what those tokens would have cost on the API — not money you were billed. Those figures are always labeled API-equivalent, so a founder dogfooding on a subscription never sees a false exact badge.
Exactness is decided by ingest route, not by auth mode. That distinction sounds pedantic until you consider what happens when an account's auth mode changes: a rule keyed on the account would silently relabel every historical row. Labels describe provenance, and provenance belongs to how the data arrived, not to a property of the account that can change later.
Where the numbers hide
A few pitfalls are worth naming, because anyone building cost measurement for agents will run into them.
Cache tokens are a first-class cost. Agent workloads are cache-heavy, and cache reads and writes are priced differently from ordinary input — sometimes with more than one write tier. Price them at zero, or at the input rate, and a cache-heavy session can look an order of magnitude cheaper than it was.
Sum tokens, not rounded cents. Individual agent calls frequently cost less than a cent. Round each one before adding them up and the totals undercount systematically. We compute cost from token totals and round once, at the end.
Rates are data, not constants. Model prices change. An exact badge sitting on a stale rate is a confident lie, so keeping prices current is part of the measurement rather than an afterthought.
An empty chart is a claim too. If two halves of a join are scoped by different credentials, the join matches nothing and the dashboard shows no spend. "No usage" and "broken pipe" look identical on a chart, so the pipeline has to be able to tell them apart.
Who gets to see it
Cost data about agents is also, inevitably, data about the people driving them. We gate visibility by the unit of disclosure rather than the sensitivity of the number.
Work-item spend is visible by default — "this ticket cost this much" is project data, and we don't publish which person was behind it. Per-person figures like cost per deliverable require that person's consent, and no admin can grant it on their behalf. Time-keyed views of individuals — here's one engineer's Monday, here's another's Tuesday — don't exist at any tier. That isn't only a policy in the copy. It's enforced in the shape of the data itself.
A number is a claim
The token meter is easy. It's a sum. Cost per deliverable is a chain of claims — this call happened once, this agent made it, this agent was working on this ticket, this ticket is real, this price is current — and every link has to hold. The work isn't computing the number. It's making every link auditable and labeling every link that's estimated.
A cost figure without its provenance is a rumor. Every number we show comes with its provenance attached.