Blog
How to attribute AI API costs per key, model, and team
An AI API bill arrives as a small number of very large line items. You get a total, usually a per-model split, and that’s where most people stop. Not because they don’t want more, but because the obvious next question turns out to be surprisingly hard: which key spent this?
That question matters more than it used to. When AI spend was a rounding error, “we spent $4,000 on OpenAI” was a complete answer. Once it’s a real line, somebody wants to know whether it was the batch pipeline, the customer-facing assistant, or one experiment somebody left running over a long weekend.
What’s available differs by provider, and so does how far you can trust it.
Start with an admin-scoped key
This trips up nearly everyone, and it fails in a way that looks like a different problem.
The key you use to make API calls cannot read billing data. For OpenAI, a regular sk-... key
or a project-scoped key will fail. You need an Admin key from Settings → Organization →
Admin keys. For Anthropic, a normal sk-ant-api03-... key fails with invalid x-api-key, which
reads like a typo rather than a permissions problem. You need either an Admin API key
(Console plan, with the “View cost reports” scope) or an Analytics API key (Claude
Enterprise).
There’s a structural requirement behind this: Anthropic cost data requires a Console organization or a Claude Enterprise plan. A personal account has no cost reporting to expose, so there’s no key that will work. Check that before you spend an afternoon on it.
OpenAI
OpenAI’s Costs API reports spend broken down by API key. Each bucket carries an api_key_id and
an amount, so per-key attribution is a real, charged figure: the same dollars that appear on
the bill, just sliced finer.
That means you can ask “what did the ingestion service’s key cost last month” and the answer is an invoiced number, not an estimate. You also get spend by model and by project from the same call.
Anthropic
The Cost Report API returns real invoiced spend by model and by workspace. But it has no per-API-key cost breakdown. Separately, the usage API does report per-key, per-model token counts. So per-key usage is exact, and per-key dollars have to be derived by pricing those tokens against a published rate card.
That derived figure is useful, and it is not invoiced. In Plutus those rows are labelled
Estimated in the breakdown table, and carry a
cost_basis field in the MCP query_costs tool so an agent querying the data programmatically
gets the same warning a person reading the chart does. The invoiced totals sitting next to them
— by model, by workspace — stay exact and are unaffected.
If a model has no rate-card entry yet, its tokens are counted but left unpriced rather than priced at a guess, so the shortfall shows up as a gap you can see rather than a total you can’t check.
If you need exact per-team chargeback on Anthropic, the answer isn’t per-key estimation at all. It’s one Workspace per team. Workspace spend comes from the Cost Report API as invoiced dollars, so the per-team figure is exact rather than approximate. It costs a bit of setup, and it’s what you want if the numbers are going into a real chargeback process.
From keys to teams
Nobody budgets by API key. They budget by team, so per-key data is only the raw material.
The bridge is a mapping from key to owner. In Plutus that’s a virtual tag, a rule that maps the
identity dimension onto a team tag value, so ingest-worker-prod and ingest-worker-staging
both roll up to the data platform team, and “what does the data platform team spend on AI” is
just a tag breakdown. Because it’s applied at query time rather than at ingest, you can rename
teams, re-map a key, or reorganise entirely, and the history re-attributes to match.
That also means AI spend lands in the same allocation model as everything else, so a team’s number includes its share of the cloud bill and its Anthropic usage, rather than living in a separate spreadsheet.
One question to ask
Whatever you use, ask this of any per-key or per-team AI cost figure:
Is this what the provider charged, or is it derived from usage?
Both are legitimate. Only one of them should be quoted in a chargeback meeting without a caveat, and plenty of tools don’t tell you which you’re looking at.

That distinction sits on the row itself rather than in a methodology page, and it separates kinds of estimate. “Estimated (list rates)” means the figure is priced from a published rate card that won’t reflect a rate you negotiated, which is a different caveat from one derived out of your own metered usage.
Setup for both providers, including the exact key types and scopes, is documented for OpenAI and Anthropic.
Get started free. No credit card, no sales call.