How to attribute AI spend by team, user, and agent: a per-request cost schema, shared-cost allocation rules, and budgets that stop runaway agents.
By

Billy Allocca

Table of Contents
Last updated: November 19, 2026
To attribute AI spend by team, user, and agent, tag every model request with the identity that made it, record token counts and the model’s price per request, allocate shared costs such as system prompts and retrieval by a written rule, and set budgets that stop runaway agents before the invoice arrives. This guide shows each step with a sample schema and compares where attribution can live.
In NexusOne’s 2026 State of the Data Estate report, conducted by Enterprise Management Associates (EMA) in September 2026 (n=202) and commissioned by NexusOne, 57% of data and analytics decision-makers said their AI and inference costs ran above projection, and 16% said well above [1]. An overrun you cannot trace to a team, a user, or an agent has no owner, so attribution has to come before optimization. The controls that act on these numbers, routing and budget enforcement at the request boundary, are covered in the companion post on how to control AI token costs, and attribution is the measurement layer those controls depend on.
What Does AI Spend Attribution Require?
AI spend attribution requires six records for every model call: who made it, who owns it, what it consumed, what it cost at the price in force, which shared costs it inherits, and which budget it counts against. AI spend attribution is the practice of assigning every dollar of model inference cost to the principal that caused it, where a principal is any identity that can make a request: a person, a service account, a scheduled job, or an AI agent. Attribution feeds two reporting models that the FinOps Foundation separates by formality: showback reports each group’s costs without posting them to budgets, and chargeback posts those costs to the organizational budget or accounting systems so each owner bears what it consumes [2].
The provider invoice cannot answer these questions by itself. OpenAI’s Costs API groups spend by project, user, line item, API key, and API source [3], and Anthropic’s Cost API groups by workspace and description at daily granularity [4], so a shared key used by six teams and forty agents arrives as one line. The FinOps Foundation’s 2026 tokenomics paper calls key-to-owner mapping the minimum viable attribution control, with each API key mapped to one team, application, or use case that has a named owner and cost center [5].
Requirement | What it records | Source of truth | What breaks without it |
|---|---|---|---|
Principal identity | User, service, or agent ID, plus the human an agent acts for | Identity provider | Spend lands on a shared key with no owner |
Ownership tags | Team, cost center, application, environment | Tag registry or CMDB | Every chargeback cycle needs manual mapping |
Metered usage | Input, cached input, cache-write, and output tokens per request | Gateway log or provider response | Costs can only be split by estimate |
Price in force | Provider, model served, service tier, price version | Price table with effective dates | A price change rewrites history |
Allocation rule | Rule ID for any shared cost the request inherits | Written allocation policy | Shared costs become a quarterly dispute |
Budget link | Budget ID and the action taken at the limit | Budget service | Overruns are discovered on the invoice |
Visibility runs well ahead of enforcement. In the same survey, 92% of respondents (n=202) can set AI spend limits at some level, but 47% can set and enforce limits at the team, application, and agent level together, 45% can do it for some teams or applications but not per agent, and 8% can monitor spend without enforcing any limit [1].
The Six Steps
Issue one identity per principal, including every agent.
Write a per-request cost record with a fixed schema.
Price each request at call time and reconcile to provider cost data daily.
Write the allocation rule for each shared cost before the first chargeback.
Choose the layer where attribution and enforcement live.
Set budgets and circuit breakers per team, application, user, and agent.
What Identity and Tag Schema Do You Need per Request?
You need one record per model call that carries the principal, the owner tags, the tokens by type, and the price used, written at the request boundary instead of reconstructed later from billing. The request boundary is the point where a request has left your application but has not yet reached a model provider, usually a gateway or control plane, where identity and metadata are still attached to it.
Step 1: Issue One Identity per Principal
Give every agent its own identity and record the human it acts for. An agent running under a developer’s personal key bills that developer, and an agent running under a shared service key bills nobody, so each agent needs two fields: its own ID, which decides the budget it draws from, and an on-behalf-of field, which records the invoking user for chargeback and audit. Provider features give you a starting point. Anthropic usage can be filtered and grouped by API key and workspace [4], and Amazon Bedrock application inference profiles accept AWS cost allocation tags so on-demand model costs group by department, team, or application [6]. But none of these knows which of your agents made a call unless your request carries that identity, and a single agent run can call more than one provider.
Step 2: Write a Per-Request Cost Record
The table below is an illustrative example schema; adapt the field names to your own logging conventions. Each row is one model call, and agent runs become chains of rows linked by a parent ID.
Field | Example value | Purpose |
|---|---|---|
request_id | req_7f3a91 | Joins the cost record to logs and traces |
parent_request_id | req_7f3a00 | Links each step of a multi-step agent run |
timestamp_utc | 2026-11-19T14:02:11Z | Places the request in a budget period |
principal_type | agent | Separates human, service, and agent traffic |
principal_id | agent.claims-triage | The identity that draws from a budget |
on_behalf_of | user.jdoe | The human who invoked the agent |
team, cost_center | claims-ops, CC-4410 | Chargeback target |
application | claims-assistant | Showback by product |
environment | prod | Keeps test traffic out of production chargeback |
provider, model_requested, model_served | provider-a, model-large, model-small | Prices the call correctly after a fallback or reroute |
input_tokens, cached_input_tokens, cache_write_tokens, output_tokens | 4,210, 3,800, 0, 612 | Each token type carries a different price |
price_version | 2026-11-01 | Reproduces the cost under the price in force |
cost_usd | 0.0213 | Computed when the request completes |
route_reason | small-model-first | Records why this model was chosen |
allocation_rule_id | shared-cache-v2 | Points to the written rule for shared costs |
budget_id, budget_action | agent.claims-triage.daily, allowed | Shows which budget was charged and what happened |
Where you can, reuse the OpenTelemetry generative AI attribute names, such as gen_ai.request.model, gen_ai.response.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gen_ai.agent.id, and gen_ai.conversation.id, which now live in a dedicated OpenTelemetry GenAI semantic conventions repository and are still evolving [7][8]. Record the requested and the served model separately, because a gateway that falls back to another model also changes the price.
Step 3: Price Each Request at Call Time and Reconcile Daily
Compute cost from tokens and a versioned price table when each request completes, then reconcile the total against provider cost data every day. LiteLLM, for example, prices requests from its model cost map, returns each call’s computed cost in an x-litellm-response-cost header, and writes every request to a spend log table [9]. Provider data arrives later and in a different shape: Anthropic usage and cost data typically appears within five minutes of a request, its cost report has daily buckets only, and Priority Tier costs are excluded from the cost endpoint and must be tracked through the usage endpoint [4], while OpenAI’s Costs API currently supports daily buckets [10].
Treat the provider’s cost data as the financial source and your request records as the allocation key. Vantage applies the same split in its LiteLLM integration, dividing matching provider cost rows by the token share of each LiteLLM tag combination and keeping any cost LiteLLM did not cover in a separate leftover row [11]. Keep your own reconciliation gap in a labeled unallocated bucket with a named owner, because a gap spread silently across teams turns into a dispute at quarter end.
How Do You Allocate Shared Costs Such as System Prompts, Retrieval, and Caching?
Allocate shared costs with a written rule chosen before the first chargeback, using direct assignment where the request record already carries the cost and proportional token share where it does not. Shared costs are larger than the token line suggests: the FinOps Foundation’s tokenomics paper reports that the infrastructure surrounding the model call routinely represents 40 to 60% of total feature spend, and it recommends joining token spend with cloud and SaaS billing on a shared workload identifier [5].
Step 4: Write the Allocation Rule for Each Shared Cost
Caching is the shared cost that most often gets misallocated. Prompt caching stores a reused prompt prefix, such as a long system prompt or a set of tool definitions, so later requests read it at a discount. On Anthropic’s API a five-minute cache write costs 1.25 times the base input price, a one-hour write costs 2 times, and a cache read costs 0.1 times for most models [12]. The first request to a cold cache pays a premium that every later request benefits from, so charging the full write to whichever user arrived first overstates that user’s cost and understates everyone else’s.
Shared cost | Example | Rule options | Suggested default |
|---|---|---|---|
Shared system prompt and tool definitions | A 3,000-token instruction block sent on every call | Direct assignment; even split | Direct, because the tokens already sit on each request record |
Prompt cache writes | The cold-cache premium on the first call of a window | Charge the writer; pool per application | Pool per application and spread by cached-read tokens |
Retrieval indexing | Embedding a document corpus and storing vectors | Corpus owner; split by query share | Corpus owner pays indexing, and each query pays its own embedding call |
Committed or provisioned capacity | Reserved throughput or a committed-spend discount | Effective rate by consumption share; central absorbs unused capacity | Consumers pay the effective rate, and unused commitment stays central |
Self-hosted model serving | A GPU cluster running open-weight models | GPU-seconds; token share; fixed fee per team | Token share, with the fixed cluster cost published alongside |
Blocked, failed, and retried requests | A jailbreak block or a timeout retry | Requesting principal; central overhead | Requesting principal, so retry loops show up on the owner’s report |
Evaluation and test traffic | Regression suites run against a new model | Owning team under a non-production tag | Owning team, excluded from production unit costs |
The FinOps Open Cost and Usage Specification (FOCUS) is an open schema for billing data maintained by the FinOps Foundation, and it gives these rules a home that finance already reads. Version 1.2, ratified in May 2025, brought SaaS and PaaS billing into the same schema as cloud billing and added virtual-currency use cases such as tracking purchases and burn-down of prepaid credits and tokens [13]. Version 1.3, announced December 11, 2025, added columns that show how providers split the costs of shared resources, plus a separate contract commitments dataset [14], and the current 1.4 specification includes Allocated Method ID, Allocated Method Details, and Allocated Tags columns [15]. If your attribution store writes its allocation rule IDs into FOCUS-shaped exports, finance can audit the split with the same tools it uses for cloud.
Where Does Attribution Live: Gateway, FinOps Tool, or Data Platform?
Attribution belongs where identity is still attached to the request, which is a gateway or a control plane, while the FinOps tool remains the place where finance reconciles and reports. In practice, most estates run both, with provider-native cost data underneath as the financial record.
Step 5: Choose the Layer That Records and Enforces
Layer | Examples and verified capabilities | Attribution grain | Real-time enforcement | Better fit when |
|---|---|---|---|---|
Provider-native usage and cost data | OpenAI Costs API grouped by project, user, line item, and API key [3]; Anthropic Usage and Cost API by API key, workspace, and model [4]; Bedrock application inference profiles with cost allocation tags [6]; Vertex AI custom metadata labels on generateContent calls [16] | Project, workspace, key, or tag | AWS Budgets alerts on tagged Bedrock spend [17]; for other providers, check current documentation | You use one provider and can map one key or project to each owner |
AI gateway | LiteLLM proxy spend tracking by key, user, team, end user, and tag [9], with budgets that reject requests [18][19]; Portkey per-request metadata for cost breakdowns [20] and budget limits that expire a key, on Enterprise and select Pro plans [21] | Per request, with any metadata you attach | Yes, at key, team, user, tag, or agent-session level depending on the product | You call several providers from many applications and need caps before the invoice |
FinOps platform | Finout virtual tags across OpenAI, Anthropic, Cursor, and cloud AI services [22]; Vantage OpenAI costs by project, model, token type, and API key ID [23], plus LiteLLM token allocation [11]; CloudZero ingestion of Anthropic, OpenAI, and Cursor costs [24] | As fine as the upstream metadata | Reporting, allocation, and alerts; check current documentation for request-level controls | Finance needs AI on the same allocated bill as cloud, with month-end chargeback |
Control plane in the data layer | Identity-aware AI control planes such as the NexusOne AI Data Control Plane | Per request, tied to the identity that governs data access | Yes, per role and per agent | Agents query governed enterprise data and you want one identity for policy, audit, and spend |
The split follows from what each layer can see. A FinOps platform reads billing and usage exports after the requests have run, so its allocation is only as fine as the tags written upstream, and Vantage’s own LiteLLM integration cannot backfill telemetry from before setup [11]. A gateway sees each call while identity and metadata are attached, so it can both record and refuse, but it sees only the traffic routed through it, which means self-hosted models and agent frameworks have to point at it too. If your AI usage runs through one provider and a handful of applications, provider-native projects plus a FinOps platform is the simpler choice and may be all you need.
The data-layer option matters when the expensive requests are agent calls over enterprise data, because the identity that decides what an agent may read is the identity its spend should attach to. Routing decisions also change cost per request, and the model routing guide covers how requests reach the right model.
How Do Budgets and Circuit Breakers Work per Agent?
Budgets cap spend over a period, and circuit breakers stop or downgrade a single agent run within minutes when it crosses a threshold, so agents need both. A circuit breaker is a rule that trips when a run exceeds a cost, token, iteration, or rate threshold and then blocks, downgrades, or pauses the agent until someone resets it. A monthly team budget catches gradual drift, but an agent caught in a tool-calling loop can consume much of a team’s period budget long before a monthly alert fires.
Step 6: Set Budgets at Every Level That Has an Owner
Level | What it caps | Example implementation | Action at the limit |
|---|---|---|---|
Organization | Total AI spend per period | LiteLLM global proxy | Block or alert |
Team or cost center | Team spend per period | LiteLLM tag budgets, which reject requests with HTTP 422 once a tag exceeds its budget [19]; AWS Budgets on tagged Bedrock profiles [17] | Reject or alert |
Application or key | Spend through one key | Portkey budget limit that expires the key [21]; LiteLLM key | The key stops working |
User | Individual spend | LiteLLM internal-user and end-user budgets [18] | Reject |
Agent session | Dollars and iterations in one run | LiteLLM agent session caps, which return HTTP 429 when exceeded [18] | Stop the run |
Model per key | Spend on one expensive model | LiteLLM model-specific budgets with fallback to another model, an Enterprise feature [18] | Downgrade |
Set the numbers from measured use. The FinOps Foundation paper recommends measuring for 30 to 60 days, setting budgets at 110 to 120% of that baseline, and alerting at 80% and 100% [5]. Then choose the exhaustion behavior per workload: a customer-facing assistant may downgrade to a smaller model and keep answering, a batch enrichment agent should stop and page its owner, and an agent acting on regulated data may need to pause for human approval.
Rationing is the most common response today. Among the 202 survey respondents, 87% have acted on rising AI cost: 47% capped usage, 29% reduced project scope, and 29% delayed a deployment [1]. Cost constraint also tracks how many systems carry a business rule. Among 187 respondents, the share whose AI deployments were constrained by cost (reduced scope, delayed, or restricted teams) was 22% where a rule change touches one system (n=23, an early read), 65% at two to three systems (n=74), and 71% at four or more (n=90) [1]. The survey measured association and did not test cause, but in NexusOne’s view the fragmentation that scatters business rules across systems also scatters the controls that would cap spend.
How NexusOne Attributes AI Spend to Principals
NexusOne attributes AI cost to principals through the same identity model that governs data access, so spend, policy, and audit share one record. Identity arrives through Keycloak federated from your directory and policy lives in Apache Ranger, so a person, a scheduled job, and an agent each carry a scoped identity, and an agent inherits the permissions of the user who invoked it.
Every model request passes through the NexusOne AI Data Control Plane, which screens it for jailbreak attempts and PII at the edge, logs allowed and blocked requests with the reasoning, and routes it: deterministic questions go to query engines such as Trino at zero tokens, then to small models, and to frontier models only when the request needs one. Cost is attributed to the principal on every request, with per-role and per-agent budgets, per-request spend ceilings, and circuit breakers that stop a runaway agent. A semantic cache returns repeated requests with no new inference, and the spend view separates cloud token spend from local execution. In NexusOne’s view, routing and caching at the boundary lower cost per request, a claim the 2026 survey did not test. Where you already run a gateway such as Portkey, the control plane interconnects with it under open standards.
The layer runs identically on-prem, in any cloud, hybrid, or air-gapped on a Kubernetes cluster you control. NexusOne’s published deployment model is 5-5-5-5: about 5 minutes to provision, 5 hours to deploy, 5 days to the first governed workload, and 5 weeks to enterprise production, with Embedded Builders working alongside your team. The governance model behind these budgets is in the post on AI token spend governance, and the ROI reporting built on the same records is in measuring AI ROI with usage attribution.
To map your providers, agents, and cost centers onto one attribution model, book an expert consultation.
Key Takeaways
AI spend attribution needs six things per model call: principal identity, owner tags, tokens by type, the price in force, an allocation rule ID, and a budget link.
Give every agent its own identity plus an on-behalf-of field for the invoking user, because shared keys make spend ownerless.
Price requests at call time from a versioned price table, reconcile daily to provider cost data, and keep any gap in a labeled unallocated bucket.
Write allocation rules for cache writes, retrieval, committed capacity, and self-hosted serving before the first chargeback, and publish them in FOCUS-shaped exports.
Record and enforce at the request boundary (a gateway or control plane), and report and reconcile in the FinOps tool.
Pair period budgets with per-agent circuit breakers, set from a 30 to 60 day baseline, with an exhaustion action chosen per workload.
Frequently Asked Questions
How Do Enterprises Measure and Attribute AI Spend by Team, User, and Agent Across Multiple LLM Providers?
They route every model call through one request boundary, usually a gateway or control plane, that attaches the principal, team, application, and agent IDs, records tokens by type, and computes cost from a versioned price table. Provider cost data from OpenAI, Anthropic, AWS, or Google is then reconciled daily, shared costs are allocated by a written rule, and any gap stays in a labeled unallocated bucket.
What Are the Best AI Token Optimization and Control Tools for Data Platforms?
The tools fall into three groups. AI gateways such as LiteLLM and Portkey track spend per request and enforce budgets. FinOps platforms such as Finout, Vantage, and CloudZero bring AI costs into the same allocation as cloud spend. Identity-aware control planes in the data layer, such as the NexusOne AI Data Control Plane, add routing and budgets tied to the identity that governs data access.
Which Enterprise Data Platforms Offer Per-Request AI Token Cost Visibility and Real-Time Budget Enforcement?
Per-request visibility with enforcement comes from the layer that sees each call before it reaches a model. LiteLLM rejects requests once a key, team, tag, or agent session exceeds its budget, and Portkey expires a key at its limit. The NexusOne AI Data Control Plane attributes cost per request and enforces per-role and per-agent budgets across cloud and self-hosted models. Billing-export tools report after usage.
What Is the Difference Between Showback and Chargeback for AI Costs?
Showback reports each team’s AI costs without moving money, which builds awareness and lets you test your allocation rules. Chargeback posts those costs to the team’s budget or accounting system, so the owner bears what it consumes, and the FinOps Foundation names that formality as the primary difference. Running showback for one full budget cycle first exposes disputed rules before real money moves.
Does the FOCUS Specification Cover LLM Token Costs?
FOCUS has covered SaaS and PaaS billing alongside cloud since version 1.2, including virtual-currency use cases for prepaid credits and tokens, and version 1.3 added columns describing how shared costs are split. Per-request attribution still comes from your own request records, which supply the team, user, and agent keys, while FOCUS-shaped exports carry the allocated results to finance for audit.
References
More Tools, Less Control: The 2026 State of the Data Estate Report, NexusOne, published September 30, 2026 (survey conducted by Enterprise Management Associates (EMA), September 2026, n=202 data and analytics decision-makers at organizations with 500+ employees in the US, Canada, the UK, and France). Retrieved October 20, 2026. https://nexus0ne.substack.com/p/more-tools-less-control-the-2026
Invoicing & Chargeback (FinOps Framework capability), FinOps Foundation. Retrieved October 20, 2026. https://www.finops.org/framework/capabilities/invoicing-chargeback/
Get costs (Organization Costs API reference), OpenAI. Retrieved October 20, 2026. https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs/methods/get_costs
Usage and Cost API, Anthropic (Claude Platform documentation). Retrieved October 20, 2026. https://platform.claude.com/docs/en/build-with-claude/usage-cost-api
Tokenomics: Managing AI Value in SaaS Model Token Costs, FinOps Foundation working group paper, last updated June 3, 2026. Retrieved October 20, 2026. https://www.finops.org/wg/token-economics-saas/
Amazon Bedrock announces support for cost allocation tags on inference profiles, AWS What’s New, November 1, 2024. Retrieved October 20, 2026. https://aws.amazon.com/about-aws/whats-new/2024/11/amazon-bedrock-cost-allocation-tags-inference-profiles
Gen AI attribute registry (attributes moved to the GenAI repository), OpenTelemetry Semantic Conventions. Retrieved October 20, 2026. https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/
Semantic Conventions for Generative AI, OpenTelemetry (GitHub repository). Retrieved October 20, 2026. https://github.com/open-telemetry/semantic-conventions-genai
Spend Tracking, LiteLLM Documentation. Retrieved October 20, 2026. https://docs.litellm.ai/docs/proxy/cost_tracking
How to use the Usage API and Cost API to monitor your OpenAI usage, OpenAI Cookbook. Retrieved October 20, 2026. https://developers.openai.com/cookbook/examples/completions_usage_api
Vantage Launches Token Allocation Support for LiteLLM, Vantage Blog, October 8, 2026. Retrieved October 20, 2026. https://www.vantage.sh/blog/litellm-token-allocation
Prompt caching, Anthropic (Claude Platform documentation). Retrieved October 20, 2026. https://platform.claude.com/docs/en/build-with-claude/prompt-caching
The FinOps Foundation Unifies Format for Cloud Billing Data with Version 1.2 of FOCUS, DBTA, June 11, 2025. Retrieved October 20, 2026. https://www.dbta.com/Editorial/News-Flashes/The-FinOps-Foundation-Unifies-Format-for-Cloud-Billing-Data-with-Version-12-of-FOCUS-169986.aspx
FinOps Foundation Launches FOCUS 1.3 to Deepen Cloud and SaaS Billing Transparency, Linux Foundation press release, December 11, 2025. Retrieved October 20, 2026. https://www.linuxfoundation.org/press/finops-foundation-launches-focus-1.3-to-deepen-cloud-and-saas-billing-transparency-announces-expanded-vendor-support-for-focus-1.2
FOCUS Specification, version 1.4, FinOps Open Cost and Usage Specification. Retrieved October 20, 2026. https://focus.finops.org/focus-specification/
Custom metadata labels, Google Cloud Vertex AI Documentation. Retrieved October 20, 2026. https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
Track, allocate, and manage your generative AI cost and usage with Amazon Bedrock, AWS Machine Learning Blog, November 1, 2024. Retrieved October 20, 2026. https://aws.amazon.com/blogs/machine-learning/track-allocate-and-manage-your-generative-ai-cost-and-usage-with-amazon-bedrock/
Budgets, Rate Limits, LiteLLM Documentation. Retrieved October 20, 2026. https://docs.litellm.ai/docs/proxy/users
Setting Tag Budgets, LiteLLM Documentation. Retrieved October 20, 2026. https://docs.litellm.ai/docs/proxy/tag_budgets
Track Costs Using Metadata, Portkey Documentation. Retrieved October 20, 2026. https://portkey.ai/docs/guides/use-cases/track-costs-using-metadata
Budget Limits, Portkey Documentation. Retrieved October 20, 2026. https://portkey.ai/docs/product/ai-gateway/virtual-keys/budget-limits
How to Monitor AI Costs in Real Time, Finout Blog, August 3, 2026. Retrieved October 20, 2026. https://www.finout.io/blog/how-to-monitor-ai-costs-in-real-time
Connecting OpenAI, Vantage Documentation. Retrieved October 20, 2026. https://docs.vantage.sh/connecting_open_ai
AI Platforms, CloudZero Documentation. Retrieved October 20, 2026. https://docs.cloudzero.com/docs/ai-platforms
