Aws/bedrock Usage
@webframp/aws/bedrock-usagev2026.05.20.1
01README
AWS Bedrock token usage monitoring — multi-account fan-out scanning of InputTokenCount and OutputTokenCount metrics via CloudWatch. Provides per-model breakdowns, tokens-per-minute rates, and invocation stats.
Authentication
Uses the AWS credential chain. Supports cross-account access via named profiles with assumed roles (SSO, credential-process, etc.).
Required IAM Permissions
cloudwatch:ListMetricscloudwatch:GetMetricData
Usage
# Single account
swamp model create @webframp/aws/bedrock-usage bedrock-usage
# Multi-account with cross-account roles
swamp model create @webframp/aws/bedrock-usage bedrock-usage \
--global-arg 'profiles=["jw-cd-lab-1/ReadOnlyPlus","jw-broadcasting-soc/ReadOnlyPlus"]' \
--global-arg 'regions=["us-east-1","us-west-2"]'
# Scan all accounts
swamp model method run bedrock-usage scan_accounts
# Single account/region
swamp model method run bedrock-usage get_token_usage \
--input profile=jw-cd-lab-1/ReadOnlyPlus --input region=us-east-1
# List active models
swamp model method run bedrock-usage list_active_modelsMethods
- scan_accounts — Fan-out across all profiles/regions, per-model breakdown
- get_token_usage — Single profile/region with model breakdown
- list_active_models — Discover models with active metrics
02Models
@webframp/aws/bedrock-usagev2026.05.12.1aws/bedrock_usage.ts
fn scan_accounts(days: number)
Fan-out scan across all configured profiles and regions. Returns per-account token usage with model-level breakdown.
| Argument | Type | Description |
|---|---|---|
| days | number | Lookback period in days |
fn list_active_models()
List Bedrock models with active metrics in a specific profile/region.
fn get_token_usage(days: number)
Get token usage for a single profile/region with model breakdown.
| Argument | Type | Description |
|---|---|---|
| days | number | Lookback period in days |
Resources
scan_results(6h)— Multi-account Bedrock token usage scan results
single_scan(6h)— Single account/region Bedrock token usage scan
active_models(1h)— Active Bedrock models in an account/region
03Previous Versions
2026.05.12.1May 13, 2026
04Stats
A
100 / 100
Downloads
1
Archive size
305.2 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
05Platforms
06Labels