AWS Builder Center
Claude Code Chargeback: Tokenomics Tuesday #1

Claude Code Chargeback: Tokenomics Tuesday #1

This is the story playing out across enterprises right now. One team tries an AI coding assistant, word spreads, and suddenly half the company is using it daily. The problem? You have no idea who's spending what, which cost centre owns it, or whether that $10,000-a-month developer is building something worth $100,000 or running an infinite loop by accident.

Series: Tokenomics Tuesday (3 articles)

  1. 3
    Claude Code Chargeback: Tokenomics Tuesday #1 This article
📺 Want to see this in action? Watch the full walkthrough:  How to Charge Back Claude Code (YouTube) 
Pillar: Visibility & Attribution

Why is this important?

Your Claude Code bill just went from $10,000 to $2 million a month. Sound familiar?
This is the story playing out across enterprises right now. One team tries an AI coding assistant, word spreads, and suddenly half the company is using it daily. The problem? You have no idea who's spending what, which cost centre owns it, or whether that $10,000-a-month developer is building something worth $100,000 or running an infinite loop by accident.
Without per-user cost attribution, you can't do chargeback. Without chargeback, teams have no incentive to optimise. And without optimisation signals, you're flying blind on the fastest-growing line item in your cloud bill.
The good news is that AWS now gives you two mechanisms to solve this, and when you combine them with your HR data, you get full organisational chargeback down to the individual user level.

What resources are relevant?

Here's what you'll need to implement Claude Code chargeback:
  • Amazon Bedrock Application Inference Profiles for division-level tagging
  • IAM Principal Cost Allocation (released April 2026) for user-level attribution
  • Amazon S3 for storing CUR data
  • Amazon Athena for joining cost data with business/organisational data
  • Amazon Redshift (optional) for fast interactive dashboards
  • A business data export stored in S3 (cost centre, team structure, project mappings)
  • LiteLLM Gateway (optional) for real-time cost tracking and spend caps
Related resources:

How to implement

Step 1: Set up Application Inference Profiles for division-level chargeback

Start here if you need quick wins. Application Inference Profiles are per-model resources that you can tag, and those tags become cost allocation tags in your CUR.
  1. Create one Application Inference Profile per division or cost centre (you only need 10-20, not thousands)
  1. Tag each profile with your organisational identifier (e.g.,  CostCenter: 12345 )
  1. Assign users to the correct profile based on their division
  1. Enable the tags as cost allocation tags in your Billing console
This gives you division-level chargeback immediately. It's the approach that works even when spend is relatively low and precision isn't critical.

Step 2: Enable IAM Principal cost allocation for user-level data

Once spend grows and you need to see individual users, enable IAM Principal cost allocation:
  1. Ensure you're using CUR 2.0 (this won't work with legacy CUR)
  1. Navigate to Billing → Cost Allocation Tags and enable the IAM Principal columns
  1. Wait 24 hours for data to start flowing
What you'll see depends on how your company provides access:
  • IAM Users: you'll see the user ARN directly
  • IAM Roles with session names: you'll see the role ARN plus the session name (which should map to a personal or project identifier)
Many organisations use IAM Roles where the session name maps to an employee or project ID. This gives you per-person or per-team Bedrock costs directly in your CUR data.

Step 3: Enrich with the Bedrock Token Cost Allocation sample

AWS provides a ready-made sample solution that sets up the full pipeline for you:  sample-bedrock-token-cost-allocation .
This deploys an Application Inference Profile, cross-account S3 replication for centralised billing, and the Athena queries you need to start analysing token costs immediately. It's the fastest path to a working chargeback setup.

Step 4: Join with business data using Athena

This is where it gets powerful. Your CUR data is already in S3. Export your business data (cost centre, team, project mappings) to S3 as well. Then:
SELECT
cur.line_item_usage_account_id,
cur.identity_line_item_id,
cur.line_item_unblended_cost,
cur.resource_tags_user_name,
biz.cost_center,
biz.team,
biz.project
FROM cur_2_0 cur
JOIN business_data biz
ON cur.iam_session_name = biz.user_id
WHERE cur.line_item_product_code = 'AmazonBedrock'
Now you have cost per person, per team, per project. You can build hierarchical reporting where leadership sees department-level spend, team leads see their team's costs, and individuals can check their own usage.

Step 5: Build the dashboard (and make sure people use it)

Load your joined data into Redshift or QuickSight for interactive dashboards. Key metrics to show each user:
  • 30-day cost broken down by model (are they 100% Opus when they should be blending?)
  • Token types: input, output, and cached tokens (if caching isn't working, you'll spot it here)
  • Daily trend to catch runaway spend early
One critical lesson: keep individual data anonymous between peers. Show users their own data, managers their team's aggregate, and leadership their department. Don't create leaderboards. One company tried that and developers started spinning up sub-agents just to top the charts. That's pure waste.

Step 6 (Optional): Add a gateway for real-time controls

If you want sub-minute cost visibility and automatic spend caps, route user traffic through a proxy like LiteLLM:
  • Intercept all requests before they hit Bedrock
  • Track cost per user in near real-time (5-10 minute delay vs. 24 hours for CUR)
  • Set daily spend caps (e.g., cut off at $2,000/day) to prevent runaway loops
  • Act as a model router so developers can access multiple models through a single config change
The gateway is "all or nothing" for user traffic. Don't deploy it unless you can get your whole org on board.

Summary

Charging back Claude Code starts simple (tag your Application Inference Profiles) and scales to sophisticated (IAM Principal allocation + HR data joins + real-time gateways). The key is to start now, even imperfectly. Enable CUR 2.0, turn on IAM cost allocation, and get that first dashboard in front of people. You'll be surprised how quickly behaviour changes when developers can actually see their own spend.


Tokenomics Tuesdays is a weekly series exploring the economics of AI tokens on  AWS Builder Centre . Follow for more on  LinkedIn .



Series: Tokenomics Tuesday (3 articles)

  1. 3
    Claude Code Chargeback: Tokenomics Tuesday #1 This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article