Reviews & Comparisons

How to Track AI Spending in Amazon Bedrock with IAM Cost Allocation

2026-05-01 09:03:45

Introduction

As teams rapidly adopt AI-driven development, cost visibility becomes a critical concern. Finance and leadership need to know who is using which AI resources and at what cost—especially when moving from experiments to production. Amazon Bedrock now supports cost allocation by IAM user and role, enabling you to tag IAM principals (like users or roles) with attributes such as team or cost center. Once activated in your Billing and Cost Management console, the resulting cost data flows into AWS Cost Explorer and the detailed Cost and Usage Report (CUR), giving you clear insight into model inference spending. Whether you’re scaling agents across teams, tracking foundation model usage by department, or running tools like Claude Code on Amazon Bedrock, this new feature is a game changer. Follow this step-by-step guide to set up cost allocation for Bedrock and take control of your AI investments.

How to Track AI Spending in Amazon Bedrock with IAM Cost Allocation
Source: aws.amazon.com

What You Need

Step-by-Step Instructions

Step 1: Identify and Organize Your IAM Principals

First, list all IAM users and roles that interact with Amazon Bedrock. These might be developer roles, service roles for CI/CD pipelines, or IAM users running Claude Code. Group them logically by team, project, or cost center. You’ll apply tags to each principal to track Bedrock usage.

Step 2: Assign Tags to Your IAM Users and Roles

Go to the IAM console, select the user or role, and navigate to the Tags tab. Click Add tags and enter a key-value pair. For example:

Repeat for all IAM principals that will use Bedrock. You can also use AWS CLI or SDK: aws iam tag-user --user-name [username] --tags Key=team,Value=engineering.

Step 3: Enable User-Defined Cost Allocation Tags in Billing

Open the AWS Billing and Cost Management console, go to Cost Allocation Tags in the left menu. In the User-defined cost allocation tags section, click Activate next to the tags you created (e.g., team, cost-center). This triggers the system to start tracking costs by these tags.

Note: Activation can take up to 24 hours to fully propagate.

Step 4: Verify Tag Activation in Cost Explorer

After activation, navigate to AWS Cost Explorer. In the Filters pane, choose Tag and select your tag key. You should see the available values (e.g., engineering). If not, wait a few more hours and refresh.

To confirm Bedrock costs appear, apply a filter for Service = Amazon Bedrock and group by your tag key. This will show model inference costs per team or cost center.

How to Track AI Spending in Amazon Bedrock with IAM Cost Allocation
Source: aws.amazon.com

Step 5: Use Cost Explorer to Analyze Bedrock Spending

In Cost Explorer, create a new report. Set the Group by dimension to Tag and choose your tag key (e.g., team). Add a filter for Service = Amazon Bedrock. The chart will display Bedrock costs segmented by tag value. You can also save the report for recurring monitoring.

For a deeper dive, export the data to a CSV or use the Cost and Usage Report (CUR) with Athena or QuickSight.

Step 6: (Optional) Set Up Budgets and Alerts

To avoid surprises, create an AWS Budget that uses your cost allocation tags. Go to Budgets in Billing, click Create a budget, choose Cost budget, and set a name. Under Filters, add a tag filter (e.g., tag:team = engineering). Set a budget amount and threshold alerts. This way, teams get notified if their Bedrock usage exceeds planned spending.

Step 7: Scale and Maintain

As new users or roles are added, remember to tag them. Use AWS IAM Tag Policies or Service Control Policies (SCPs) to enforce tagging for IAM principals. You can also automate tagging via AWS Lambda or CloudFormation.

Periodically review your cost allocation reports to ensure tags are applied correctly and no costs are unassigned.

Tips for Success

With this setup, you’ll gain full visibility into AI costs—empowering teams to innovate without financial surprises.

Explore

A Step-by-Step Guide to Understanding Curiosity's Organic Molecule Discovery on Mars Clearing the Skies for Emergency Drones: NASA's Priority Access Test Inside Telegram's Media Engine: How to Build a High-Performance Extraction Tool Using MTProto and Async I/O Building Better Wave Energy Converters: A Data-Driven Modeling Guide 6 Crucial Things to Understand About Purdue Pharma's Dissolution and Settlement