AWS and Databricks each published guidance on November 13 for the same problem: companies are giving AI coding agents to every engineer and want to know who spent what. AWS showed how Amazon Bedrock traces each inference call from tools such as Claude Code, OpenAI Codex and ChatGPT Work back to the person who made it. Databricks described routing Codex through its Unity Gateway, where engineering leaders set budgets and review spend by team.
What AWS published
According to the AWS Machine Learning Blog post, Bedrock records the IAM identity of every caller with no change to the API calls and writes it to the AWS Cost and Usage Report (CUR 2.0) in a column named line_item_iam_principal. Claude Code, Claude Desktop, OpenAI Codex, ChatGPT Work and OpenCode all reach Bedrock through one of two endpoints, bedrock-runtime or bedrock-mantle, and AWS says the attribution works at that endpoint layer, so any tool routed through Bedrock picks it up.
The setup AWS describes connects an external identity provider such as Okta, Microsoft Entra ID or Ping Identity to IAM Identity Center. Each user then signs in with their own session name, and organizational attributes such as team and cost center travel as session tags into the billing data.
Where per-user attribution breaks
AWS lists the cases where the bill collapses back to one line. If every user assumes a shared role with the same fixed session name, or if calls pass through an LLM gateway using the gateway’s own role, CUR aggregates the spend to a single principal. If a developer has the AWS_BEARER_TOKEN_BEDROCK variable set, Claude Code and Codex authenticate with that key, and the calls are attributed to the IAM user behind it.
The data also arrives late and coarse. CUR holds no per-request cost: usage is rolled up per principal and per usage type for each export interval, hourly or daily. Bedrock bills input, output, cache-read and cache-write tokens separately, so one hour of one person’s activity typically produces four rows. Tags take up to 24 hours to appear in Billing and up to 48 hours to reach CUR 2.0 and Cost Explorer, and activation is not retroactive.
The enforcement gap
Seeing spend and stopping it are separate jobs, and the AWS post sets out four ways to cap usage, each with a different delay.
- AWS Budgets with budget actions needs no custom infrastructure. It updates up to three times a day, and Bedrock charges can take up to 24 hours to reach billing data, so AWS says a high-velocity user can overshoot by up to a day before the limit takes effect.
- CloudWatch alarms with Lambda use Bedrock’s token and invocation metrics and cut the delay to 1 to 5 minutes. Per-user limits on this route need Application Inference Profiles or per-user roles.
- A DynamoDB quota table tracks tokens per user and withholds credentials once a limit is passed. It takes effect at the next credential refresh.
- An LLM gateway proxy blocks each call as it happens, at the cost of the most operational work and added latency on every request.
AWS says organizations typically layer these: CUR 2.0 for reporting, a gateway or DynamoDB-based enforcement for real-time control, and AWS Budgets as a backstop.
What Databricks published
The Databricks post places the meter in the request path. Codex signs in with a Databricks credential, the OpenAI key stays in Unity Gateway and every request is logged. Engineering leaders set budgets, review spend by team and pick which GPT model handles which task. The developer setup is one command, ug codex, according to the post.
The Databricks documentation for the Codex connection adds two details a FinOps team will care about. Unity Gateway attributes access control and usage logs to the identity tied to the Databricks token on each request, so the token has to belong to the person running the agent. Codex can also run on a user’s ChatGPT Go, Plus, Pro or Enterprise subscription through the gateway, in which case the requests are billed against that subscription while the gateway keeps access control, routing and usage governance. The documentation says Unity Gateway is generally available.
Databricks says its partnership with OpenAI began in September 2025 as a multi-year agreement, that OpenAI is one of its largest customers and that every Databricks engineer is getting access to Codex.
Where the two approaches differ
Read together, the two posts put the meter in different places. The AWS route measures in the cloud bill, after the fact, and adds enforcement on top with a delay that ranges from minutes to a day. The Databricks route is a gateway that sees each request before it reaches the model, which is the option AWS’s own post describes as giving per-call blocking with the most operational overhead. The AWS post also notes a third place: for Claude for Enterprise, per-user usage sits in Anthropic’s admin console and Anthropic enforces spend limits itself.
The two posts share one requirement. Both only produce a per-person number if each request carries that person’s identity, whether as an IAM session name or as a Databricks token. A shared role, a shared key or a gateway calling with its own credentials turns a per-user report into a single total.
Vendors are adding limits of their own. OpenAI said it will pool ChatGPT and Codex usage into one allowance in December, and AWS earlier published a design that gives agent payments a per-session spend cap set outside the model. Google shipped real-time spend caps in Gemini Agent.
What it means for the buying committee
For the platform and FinOps leads
Decide where the meter sits before the rollout, because the choice fixes how fast a limit can bite. A budget enforced from billing data can trail usage by a day, by AWS’s own numbers. A gateway enforces per call but adds a component in the path of every request, with its own latency and on-call cost.
For identity and security teams
Per-user cost depends on per-user credentials. Audit how coding tools authenticate today: shared roles, long-lived personal access tokens and environment-variable API keys all defeat attribution, and the Databricks documentation describes a personal access token as a long-lived credential tied to the user’s identity.
For procurement
The same Codex request can be billed through a cloud commitment, an OpenAI contract or a user’s ChatGPT subscription, depending on how it is routed. Contracts and expense policy should say which route is approved for company code.
Actions for the CIO and CAIO
Ask each team running coding agents for three answers: which endpoint or gateway their tools call, which credential identifies the user on each request, and how long it takes for a spend limit to stop a runaway session. Where the answer to the last one is a day, add a faster control in front of the budget. Then set the reporting cadence by team and cost center, since both AWS and Databricks now support that split.
Source: AWS Machine Learning Blog, Cost attribution and controls for AI developer and productivity tools on Amazon Bedrock. Additional sources: Databricks, OpenAI and Databricks: Enterprise AI on your governed data; Databricks documentation, Codex with Unity Gateway.