Half 1 launched granular price attribution for Amazon Bedrock. This function robotically traces each inference request again to the IAM principal that made the decision. It confirmed how the brand new line_item_iam_principal column can provide you per-user and per-application visibility. With optionally available price allocation tags, you may as well combination spend by workforce, challenge, or tenant utilizing AWS Price Explorer. With this method, you may sometimes monitor utilization on the granularity you need for any Bedrock-powered service or utility, whether or not third-party instruments like Claude Code or Codex or your personal customized builds. This submit reveals how one can visualize and analyze price attribution for Amazon Bedrock by Amazon Athena queries and CUDOS dashboards.
First, this submit reveals you how one can arrange Price and Utilization Report (CUR) 2.0 by Knowledge Exports instrumented with IAM principal knowledge. Subsequent, this submit reveals you how one can question CUR knowledge with Amazon Athena for evaluation. It then introduces the brand new capabilities of CUDOS dashboards, together with granular Bedrock price and utilization knowledge. Whereas Athena supplies flexibility for aggregations, integration with completely different enterprise intelligence (BI) instruments, and chargeback processes, CUDOS affords pre-built visuals tailor-made to your group’s particular construction.
Instance question output exhibiting Amazon Bedrock prices by IAM principal and utilization sort
Organising Price and Utilization Experiences (CUR 2.0)
Earlier than you may analyze Amazon Bedrock prices, arrange a CUR 2.0 knowledge export and join it to Amazon Athena.
Conditions
You want the next:
- An AWS account with billing console entry.
- IAM permissions for Price and Utilization Experiences, S3, and Athena.
- An S3 bucket for CUR knowledge storage.
- Fundamental familiarity with SQL and the AWS Administration Console.
- (Non-compulsory) Claude Code or Kiro-CLI for automated setup.
Be sure you have the required IAM permissions.
For Amazon Bedrock price attribution, it is advisable allow IAM principal knowledge in your CUR 2.0 export in order that the line_item_iam_principal column and related IAM principal tags are populated.
Making a CUR 2.0 knowledge export with IAM principal knowledge
Comply with the directions in Creating a regular knowledge export to arrange your CUR 2.0 export. When configuring the export, be sure the next choices are a part of your ultimate configuration:
Making a CUR 2.0 customary knowledge export with caller identification (IAM principal) allocation knowledge enabled
- In Further export content material, choose the next checkboxes:
- Embrace caller identification (IAM principal) allocation knowledge — That is the vital setting that populates the
line_item_iam_principalcolumn and surfaces IAM principal tags (prefixed withiamPrincipal/) in your price knowledge.
- Embrace caller identification (IAM principal) allocation knowledge — That is the vital setting that populates the
- In Knowledge desk configurations:
- Time granularity: Choose Hourly for max element.
- In Knowledge export supply choices:
- File versioning: Choose Overwrite present report back to keep away from storing duplicate knowledge.
Vital: Enabling IAM principal knowledge will increase CUR file sizes as a result of utilization that was beforehand a single row is now expanded into a number of rows, one for every IAM principal that contributed to the utilization. For prime-volume workloads with many distinct principals, plan your Amazon S3 storage accordingly and contemplate Amazon S3 Lifecycle insurance policies for older CUR information.
It might take as much as 24 hours for AWS to ship your first CUR 2.0 report back to the S3 bucket.
Connecting CUR 2.0 to Amazon Athena
With Amazon Athena, you may question your CUR knowledge utilizing customary SQL with no infrastructure to handle. To streamline this setup, an optionally available agent.md talent repo is accessible that you should use with AI assistants like Claude Code, Kiro-CLI, or Codex. It automates the end-to-end technique of connecting your Athena setting to your CUR knowledge.
- Clone the repo (
git clone https://github.com/aws-samples/sample-cur-iam-principal-bedrock-tracking). - Launch Claude Code (
claude) or Kiro CLI (kiro) on this listing. - Immediate: “Learn agent.md and comply with its workflow to arrange Price and Utilization Report monitoring and run the Amazon Bedrock-by-principal question for the present month.”
You may additionally comply with the manual setup steps.
In case you plan to deploy the CUDOS dashboard as effectively, you may deploy it from AWS CloudFormation. This additionally deploys the Athena question database as a part of the method.
As soon as deployed, here’s a pattern take a look at question within the Athena Question Editor that you should use:
If this returns rows with IAM principal ARNs and Bedrock utilization varieties, your setup is full and prepared for deeper evaluation.
Athena question patterns for Bedrock price monitoring
Along with your CUR 2.0 knowledge out there in Athena, now you can reply granular price attribution questions utilizing SQL. This part supplies three progressively refined question patterns that cowl the most typical evaluation situations.
Notice: Within the following queries, substitute your_cur_table_name with the precise title of your CUR Athena desk (for instance, cid_data_export.cur2).
Question 1: Bedrock prices by IAM principal and utilization sort
This question supplies an entire breakdown of Amazon Bedrock spending by caller identification and mannequin utilization. It solutions the query: “Who is looking which fashions, and the way a lot are they spending?”
Instance output:
| line_item_iam_principal | line_item_usage_type | total_tokens | total_cost |
| arn:aws:sts::123456789012:assumed-role/ChatApp/session-1 | USW2-anthropic.claude-opus-4-8-mantle-cache-write-tokens-standard | 1629.5 | $11.2029 |
| arn:aws:sts::123456789012:assumed-role/DocProcessor/batch-7 | USW2-Claude4.6Sonnet-output-tokens | 68.579 | $1.131 |
| arn:aws:sts::123456789012:assumed-role/ClaudeCode/chat | USW2-Claude4.6Sonnet-cache-write-input-token-count | 831.74 | $3.4309 |
| arn:aws:iam::123456789012:consumer/alice | USW2-Claude4.6Sonnet-input-tokens | 17.33 | $0.0572 |
Evaluation ideas:
- Use LIKE patterns reminiscent of
line_item_usage_type LIKE '%Sonnetpercentoutput%'or%nova%to filter for particular fashions. - The
line_item_iam_principalcolumn comprises the total ARN. For assumed roles, the session title after the final/identifies the particular consumer or session.
Question 2: Prices damaged down by recognized IAM principal tags
Once you’ve tagged your IAM principals with dimensions like workforce, challenge, or costcenter (and activated these tags as price allocation tags), they seem in your CUR 2.0 knowledge as a part of the tags columns, with the iamPrincipal/ prefix adopted by your tag key. This question teams prices by these tags to reply questions like: “How a lot did the engineering workforce spend on Bedrock this month?” or “What’s the whole Bedrock price for the chatbot challenge?”
By challenge:
Instance output:
| challenge | line_item_usage_type | total_tokens | total_cost |
| data-science | USW2-Claude4.5Sonnet-cache-write-input-token-count | 433.893 | 1.789808625 |
| data-science | USW2-Claude4.6Sonnet-cache-read-input-token-count | 5372.659 | 1.77297747 |
| engineering | USW2-Claude4.5Sonnet-input-tokens | 29.481 | 0.0972873 |
| engineering | USW2-Claude4.5Sonnet-output-tokens | 31.102 | 0.513183 |
Notice: This question returns outcomes provided that your IAM principals have been tagged with the related keys and people tags have been activated as price allocation tags.
Question 3: Dynamic tag discovery utilizing UNNEST for unknown tag schemas
In massive organizations, chances are you’ll not know prematurely which tags have been utilized throughout all IAM principals. Completely different groups may use completely different tag keys, or new tags could be launched over time. The next instance reveals how one can dynamically discover utilizing Athena’s UNNEST perform.
This question discovers all IAM principal tags getting used throughout your Bedrock workloads and reveals price allocation for every tag key-value pair:
Actual-world use case: Multi-service price comparability
Take into account a platform workforce operating a number of AI-powered companies. For instance, the workforce may run a doc summarization pipeline (DocProcessor) and a customer-facing chatbot (ChatApp). The workforce can assign every service to its personal IAM position. With the question patterns from the previous part, you may isolate how the spend for every service developments with the next question:
Instance output:
| line_item_iam_principal | line_item_usage_type | total_usage | total_cost |
| arn:aws:sts::123456789012:assumed-role/ChatApp/session-1 | USE1-Claude4.6Sonnet-output-tokens | 4,800,000 | $72.00 |
| arn:aws:sts::123456789012:assumed-role/ChatApp/session-1 | USE1-Claude4.6Sonnet-input-tokens | 2,900,000 | $8.70 |
| arn:aws:sts::123456789012:assumed-role/DocProcessor/batch-7 | USE1-NovaLite-output-tokens | 6,100,000 | $1.46 |
| arn:aws:sts::123456789012:assumed-role/DocProcessor/batch-7 | USE1-NovaLite-input-tokens | 3,200,000 | $0.19 |
From this output, the platform workforce can reply questions like:
Which utility is the highest contributor to this month’s Bedrock spend? On this instance, ChatApp accounts for over $80 utilizing Claude 4.6 Sonnet, whereas DocProcessor prices underneath $5 utilizing Nova Lite.
May we cut back prices by utilizing a unique mannequin for every workload? DocProcessor is already on Nova Lite (acceptable for easy summarization duties), however the workforce may consider whether or not ChatApp may deal with some interactions with a lighter mannequin to cut back the $72 output-token price.
Price of Athena queries
You pay just for the queries that you just run. You might be charged based mostly on the quantity of information scanned by every question. The console shows this data after every question, and this data can be out there within the Latest Queries tab within the Athena console.
Athena queries are billed at $5 per TB scanned (with a ten MB minimal per question). As a result of our desk robotically makes use of hive partition projection on billing_period, queries scoped to a single month solely scan the parquet information in that month’s folder. Scans are sometimes effectively underneath 10 MB, which prices about $0.00005 per question (the ten MB minimal).
To maintain prices low, at all times embrace a WHERE billing_period = ... filter and choose solely the columns you want somewhat than SELECT *.
The Cloud Intelligence Dashboards framework
CUDOS dashboard is a part of the open supply Cloud Intelligence Dashboards (CID) framework, which you’ll deploy in your AWS account utilizing the offered infrastructure as code (IaC) templates. The framework helps you drive monetary accountability and improve operational effectivity throughout your AWS organizations. The CUDOS dashboard supplies detailed and actionable insights, supporting data-driven choices for price effectivity throughout your AWS infrastructure.
Amazon Bedrock price and utilization insights in CUDOS
CUDOS version 5.8 introduces a complete Amazon Bedrock part within the AI/ML tab, with full IAM principal price attribution help. The dashboard supplies:
- Versatile grouping dimensions: Group your Amazon Bedrock spend by IAM Principal, IAM Principal Tags (reminiscent of Venture or Crew), Mannequin/Useful resource Group, Area, or another price taxonomy fields configured throughout dashboard deployment.
- Price-per-million-tokens monitoring: A development line overlaid in your spend chart exhibiting how price per million tokens evolves over time, serving to you measure the impression of mannequin choice modifications or immediate optimization efforts, like caching for instance.
The next determine reveals the Amazon Bedrock Abstract part within the AI/ML tab of the CUDOS dashboard, grouped by IAM principal, with per-principal price breakdown and cost-per-million-tokens development.
CUDOS dashboard exhibiting Amazon Bedrock spend grouped by IAM principal
- Interactive drill-down filtering: Select any worth within the top-level spend chart (reminiscent of a particular challenge, principal, or account) and each different visible robotically filters to that choice, letting you drill from a high-level overview into per-model and per-usage-type element with out navigating away from the dashboard.
- Granular mannequin and utilization breakdown: Further visuals, filtered by the top-level chart, present spend per mannequin, per utilization sort, and cost-per-million-tokens by mannequin, so you may determine which fashions and token varieties are driving prices for a given workforce or challenge.
Once you swap the grouping to IAM Principal Tag Venture and select a particular challenge (on this instance, “chatbot-v2”), all different visuals filter to indicate solely that challenge’s spend. The visuals break down that spend by mannequin, utilization sort, and unit price developments.
CUDOS dashboard exhibiting Amazon Bedrock spend grouped by IAM principal tag Venture, filtered to the chatbot-v2 challenge
With these visuals, you may shortly reply questions like “Which challenge is driving essentially the most output token prices?”, “Is our chatbot workforce utilizing cost-efficient fashions?”, or “How has our price per million tokens modified since we switched from Opus to Sonnet?”, with out writing any SQL.
Getting began with CUDOS
To get began with CUDOS, you may discover the Bedrock part in an interactive demo dashboard. Comply with the deployment information to arrange CUDOS in your group.
In case you’re already utilizing CUDOS, comply with the replace steering to improve to model 5.8. You too can use the add organizational taxonomy so as to add IAM Principal knowledge to your present CUDOS dashboard.
Clear up
First, drop the Athena desk and AWS Glue database (these are metadata, so no compute is operating):
Warning: Dropping the Athena desk and Glue database will take away your potential to question CUR knowledge. You will want to recreate these sources following the previous part if you wish to analyze billing knowledge sooner or later.
Second, for those who not want the fee knowledge itself, disable the export within the AWS Billing and Price Administration console underneath Knowledge Exports and empty the S3 prefix it writes to. Notice that is your uncooked billing historical past, so solely delete it for those who’re positive.
Lastly, filter any Athena question outcomes which have gathered:
There aren’t any crawlers, AWS Lambda features, or schedules to delete. Partition projection means the one ongoing price is S3 storage for the CUR information themselves, which is often pennies per 30 days.
For cleansing up CUDOS, check with the CUDOS dashboard teardown directions.
Conclusion and subsequent steps
This two-part sequence walked by an entire toolkit for understanding and managing Amazon Bedrock inference prices:
- Half 1 launched granular price attribution: how Amazon Bedrock robotically captures the IAM principal behind each inference name, and the way you should use price allocation tags to combination spend by workforce, challenge, or tenant.
- Half 2 (this submit) confirmed you how one can put that knowledge to work: establishing CUR 2.0 with IAM principal knowledge, querying price patterns in Amazon Athena, and evaluating spend throughout tasks and principals to tell price allocation choices. It additionally introduces the CUDOS dashboard, which supplies a complete AI/ML sheet with comparable insights for Bedrock.
Activate CUR 2.0 with caller identification knowledge within the AWS Billing console, join it to Athena utilizing the offered agent.md file, and run your first cost-by-principal question. Observe Bedrock adoption throughout your group with the CUDOS dashboard.
In regards to the authors

