Aws/bedrock Usage
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=["my-account/ReadOnlyPlus","my-other-account/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=my-account/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
2026.08.21.1
Changed: CloudWatch API failures during scan_accounts, get_token_usage,
and list_active_models now raise an error naming the failing operation
(ListMetrics, GetMetricData) along with the profile, region, and — where
applicable — the model ID being queried. Previously these calls surfaced the
raw AWS SDK error with no indication of which account, region, or metric
request had failed.
Changed: The profiles and regions global arguments now require at
least one non-empty entry each. Previously an empty array silently produced
a no-op scan instead of a clear validation error.
| Argument | Type | Description |
|---|---|---|
| days | number | Lookback period in days |
| Argument | Type | Description |
|---|---|---|
| days | number | Lookback period in days |
Resources
2026.08.20.1
Changed: Bump @aws-sdk/* 3.1111.0 → 3.1114.0 (2 packages)
2026.08.15.1
Changed: Bump @aws-sdk/* 3.1104.0 → 3.1111.0 (2 packages)
2026.08.05.1
Changed: Bump @aws-sdk/* 3.1101.0 → 3.1104.0 (2 packages)
2026.08.02.1
Changed: Bump @aws-sdk/* 3.1100.0 → 3.1101.0 (2 packages)
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.29.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.29.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.29.1
Fixed: Terminate upgrade chain at current version (extension was uninstallable due to broken upgrade chain).
2026.07.27.1
Changed: Bump @aws-sdk/* 3.1094.0 → 3.1096.0 (2 packages)
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.08.15.1
Changed: Bump @aws-sdk/* 3.1104.0 → 3.1111.0 (2 packages)
2026.08.05.1
Changed: Bump @aws-sdk/* 3.1101.0 → 3.1104.0 (2 packages)
2026.08.02.1
Changed: Bump @aws-sdk/* 3.1100.0 → 3.1101.0 (2 packages)
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.29.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.29.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.29.1
Fixed: Terminate upgrade chain at current version (extension was uninstallable due to broken upgrade chain).
2026.07.27.1
Changed: Bump @aws-sdk/* 3.1094.0 → 3.1096.0 (2 packages)
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.08.05.1
Changed: Bump @aws-sdk/* 3.1101.0 → 3.1104.0 (2 packages)
2026.08.02.1
Changed: Bump @aws-sdk/* 3.1100.0 → 3.1101.0 (2 packages)
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.29.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.29.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.29.1
Fixed: Terminate upgrade chain at current version (extension was uninstallable due to broken upgrade chain).
2026.07.27.1
Changed: Bump @aws-sdk/* 3.1094.0 → 3.1096.0 (2 packages)
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.08.02.1
Changed: Bump @aws-sdk/* 3.1100.0 → 3.1101.0 (2 packages)
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.29.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.29.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.29.1
Fixed: Terminate upgrade chain at current version (extension was uninstallable due to broken upgrade chain).
2026.07.27.1
Changed: Bump @aws-sdk/* 3.1094.0 → 3.1096.0 (2 packages)
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.29.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.29.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.29.1
Fixed: Terminate upgrade chain at current version (extension was uninstallable due to broken upgrade chain).
2026.07.27.1
Changed: Bump @aws-sdk/* 3.1094.0 → 3.1096.0 (2 packages)
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.07.29.1
Fixed: Terminate upgrade chain at current version (extension was uninstallable due to broken upgrade chain).
2026.07.27.1
Changed: Bump @aws-sdk/* 3.1094.0 → 3.1096.0 (2 packages)
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.07.21.1
Changed: Bumped AWS SDK dependencies to 3.1091.0 (from 3.1090.0).
Upgrade note: No behavioral changes. Routine dependency maintenance.
2026.07.18.2
Added: An upgrades array entry (no-op) to bedrock_usage.ts for proper typeVersion tracking on existing instances. No schema or behavior changes.
2026.07.18.1
Changed: Bumped @aws-sdk/client-cloudwatch and
@aws-sdk/credential-providers from 3.1069.0 to 3.1090.0 for dependency
freshness. No behavior change.
2026.07.10.1
Changed: Replaced internal org identifiers in the manifest usage examples with generic placeholders. No functional, API, or schema changes.
2026.07.18.1
Changed: Bumped @aws-sdk/client-cloudwatch and
@aws-sdk/credential-providers from 3.1069.0 to 3.1090.0 for dependency
freshness. No behavior change.
2026.07.10.1
Changed: Replaced internal org identifiers in the manifest usage examples with generic placeholders. No functional, API, or schema changes.
2026.07.10.1
Changed: Replaced internal org identifiers in the manifest usage examples with generic placeholders. No functional, API, or schema changes.
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned