Your provider invoice stops at the API key
Your finance lead forwards the provider invoice and asks which agent spent it. You can name the project or the key. You cannot name the agent, and you cannot say whether that agent was worth what it cost.
Nobody has the full list of agents, nobody owns the bill, and when one misbehaves you hear about it from a ticket.
Why the invoice cannot answer
OpenAI reports cost by project and key. Anthropic reports it by workspace. An agent is neither. Two agents that share a key land on the same line, and so does the script a developer ran last Tuesday.
What answers it
Cost per agent needs every model call to carry an agent key. Metrx takes the calls from the SDK (TypeScript or Python) or from OpenTelemetry and records each one with its agent key, the model, the token counts and the cost. The grain is the call and the source is your own instrumentation, so the cost per agent is measured.
That covers the agents your team can instrument. The provider cost APIs and a card feed are not running yet, and they would report at the provider’s grain, not per agent.
Cost needs something to divide by
Cost per agent says what an agent spent. Judging it takes what it produced, next to it.
You write each agent a job contract: the objective, the unit of work, the acceptance criteria, a budget and an owner. Outcomes carry a label. Measured means observed directly. Attributed means a modeled estimate with a stated confidence. Cost divided by attributed outcomes gives cost per attributed outcome, and the scorecard checks each term of the contract and marks it Meets, Misses, Not graded or Tracking.
Cost per agent next to outcomes per agent is an agent P&L. The agent P&L is demo-proven on Northwind, a synthetic demo org, and the job contract form and scorecard are shipped.
Do this before the next invoice
List every agent you run and mark the ones your team can instrument with the SDK or OpenTelemetry. For each of those, write the job: what it is for, what one unit of work is, what counts as done, and who owns it. Then connect one source. See what each agent cost and what it produced.
CC BY-NC 4.0 2026 © Metrx · Connect one source. See what each agent cost and what it produced.