How to know where your AI agent money goes
AI agents are your newest monthly bill. Engineers run them, and so do designers, project managers and your support team. Maybe you are an agency and want to pass that cost on to your clients. Or you build a product, and your team says AI makes them much faster. But do you know what each feature cost to build? Which bill paid for it? Did anyone plan for it, and who answers for it?
The bills alone will not tell you. You may pay one provider for an API account and the same provider again for seats on a plan, and a third bill comes from another provider. None of them says which project the money went to. What your agents used, on the other side, says a lot about the work and nothing about what you were charged. You need both, kept apart, and a way to connect them. Here is how to think about it, in five steps.
Record what your agents use
Every model call an agent makes is a message: who ran it, which agent, which model, when, and how many tokens of each kind. Keep everything else that came with it too, such as the branch, the repository or how the agent was signed in. You may not know today what it is good for, and you cannot get it back later. A price table, one row per provider, model and token kind, turns tokens into cost. When a price is not certain, say so: a message that is not priced yet is still counted, never shown as zero.
| Session | Person | Agent | Signed in with | Cost |
|---|---|---|---|---|
| S1 | Mara | Claude Code | a seat plan | 400.00 |
| S2 | Mara | Codex | an API key | 300.00 |
| S3 | Tom | Review bot | an API key | 100.00 |
| S4 | Tom | Claude Code | an API key | 150.00 |
| Messages | 950.00 |
Take the bills as they are
A bill belongs to a contract: one thing a provider charges you under. An API account is metered: you pay per token. A seat plan is flat: you pay a fee, and maybe extra usage on top. Two contracts with the same provider are two contracts, each with its own bills. Bills arrive on their own schedule, and nothing about them needs to be known when your agents run.
| Contract | Provider | Kind | Bill |
|---|---|---|---|
| anthropic-api | Anthropic | metered | 270.00 |
| openai-api | OpenAI | metered | 300.00 |
| claude-team | Anthropic | flat: fee 200.00 + extra usage 50.00 | 250.00 |
| Bills | 820.00 |
Say what the work was for
Now connect the two with tags. A tag says what something was for: a feature, a project, a client, and a contract. Tags go on messages afterwards, by a rule that reads what came with them ("signed in with a seat plan means claude-team", "this repository is project Shop"), by a default (a feature brings its project, a project brings its client), or by hand. They go on bills through their contract. Rules run back in time, so a rule you add today may tag last month too. A session that served two features gets a split.
| Session | Contract | Work | Label | Cost |
|---|---|---|---|---|
| S1 | claude-team | KD-1 | direct | 400.00 |
| S2, 60 % | openai-api | KD-1 | direct | 180.00 |
| S2, 40 % | openai-api | KD-2 | direct | 120.00 |
| S3 | anthropic-api | Shop | project overhead | 100.00 |
| S4 | anthropic-api | none | organization overhead | 150.00 |
| Messages | 950.00 |
Check each bill
With the contract on both sides, each bill meets the messages under the same contract. A metered bill should equal their cost, plus what no message explains, such as chat in the provider's own app. A flat bill is the fee plus extra usage, and what the plan covered becomes visible: here the seat plan covered 350.00 of usage for a fee of 200.00. Next to every check, keep the messages of the same provider that have no contract yet, and those that took a contract only because their provider has just one. Otherwise a check could look right only because something was left out.
| Contract | Bill | Messages | Unexplained | Covered by the plan | Difference |
|---|---|---|---|---|---|
| anthropic-api | 270.00 | 250.00 | 20.00 | – | 0.00 |
| openai-api | 300.00 | 300.00 | 0.00 | – | 0.00 |
| claude-team | 250.00 | 400.00 | – | 350.00 | 0.00 |
| Anthropic, no contract | 0.00 | ||||
| OpenAI, contract from the fallback | 300.00 |
For the seat plan: fee 200.00 + extra usage 50.00 = bill 250.00, and 400.00 of usage − 50.00 extra = 350.00 covered by the plan.
Plan, then compare
Once cost is recorded and checked, you may estimate work before it starts, the way you estimate hours, from what similar past work cost. Accept an estimate, and it is the plan for its feature or project. Plan less cost is the deviation, for a feature, a project, a person or a team. The next estimate learns from it.
| Work | Plan | Cost | Deviation |
|---|---|---|---|
| Shop | 232.50 | 800.00 | −567.50 |
| KD-1 | 500.00 | 580.00 | −80.00 |
Cost and what you paid. Reports show what the work cost at the price table: 950.00, of which 400.00 ran on the seat plan. The bills say what you paid: 820.00. In controlling terms the first is standard cost and the second is actual cost, and the difference has a name on every line.
I've built software for clients for fifteen years, and I built Token Controller because I needed these answers for my own managers and clients. It gives the people who run agents an easy way to show what the work was, and the people who pay a number they can check. Claude Code, Codex, Gemini CLI and Copilot CLI are supported, and any other agent can report through the API. It is free for one person, 200 USD or 200 EUR a month per organization on the Team plan, and free to self-host under the AGPL.
For the people who run the agents, it takes almost no effort. Cloud and CI agents report on their own, and laptop sessions are connected to features through the Claude Code mod.
There is more when you need it: project and organization overhead, passing cost through to clients, a cutoff that keeps figures fixed for finance, and self-hosting on your own servers.
You can start alone in a few minutes at tokencontroller.com and add your team when the first month closes. If you answer for AI spend, I'd like to hear how you handle your AI bill today. Write to me and I'll show you how it works.