Skip to main content

Aws/bedrock Usage

@webframp/aws/bedrock-usagev2026.08.21.1· 1d agoMODELS
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:ListMetrics
  • cloudwatch: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_models

Methods

  • 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
02Release Notes

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.

03Models1
@webframp/aws/bedrock-usagev2026.08.21.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.
ArgumentTypeDescription
daysnumberLookback 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.
ArgumentTypeDescription
daysnumberLookback 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
04Previous Versions15
2026.08.20.1

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

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

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

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

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

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

2026.07.24.1

Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).

2026.07.21.1

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

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

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

2026.07.10.1

Changed: Replaced internal org identifiers in the manifest usage examples with generic placeholders. No functional, API, or schema changes.

2026.06.21.1
2026.06.15.1
2026.05.20.1
2026.05.12.1
05Stats
A
100 / 100
Downloads
6
Archive size
249.5 KB
  • 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
06Platforms
07Labels