Ai Usage
Unified cross-provider AI token usage monitoring — workflow, model, and report that aggregates Bedrock, Vertex AI, and Azure OpenAI token data into a single view.
Gracefully handles partial provider configurations. Unconfigured providers are shown with setup hints in the report output.
Quick Start
# Pull the extension (also pulls provider dependencies)
swamp extension pull @webframp/ai-usage
# Configure providers you use (any subset works)
swamp model create @webframp/aws/bedrock-usage bedrock-usage \
--global-arg 'profiles=["default"]' --global-arg 'regions=["us-east-1"]'
swamp model create @webframp/gcp/vertex-usage vertex-usage \
--global-arg 'projects=["my-project"]'
swamp model create @webframp/azure/openai-usage azure-ai-usage \
--global-arg 'subscriptions=["sub-id"]'
# Create the unified model
swamp model create @webframp/ai-usage ai-usage
# Check provider status
swamp model method run ai-usage status
# Run the full scan workflow
swamp workflow run @webframp/ai-usage-scan
# Or generate report from existing data
swamp model method run ai-usage generateMethods
- status — Check which providers are configured, with setup hints
- generate — Produce unified report from collected scan data
Workflow
- @webframp/ai-usage-scan — Orchestrates scan across all configured providers then generates the unified report
Report
- @webframp/ai-usage-report — Workflow-scope report for standalone use
2026.08.05.1
Changed: Bump @webframp/aws/bedrock-usage 2026.08.01.1 → 2026.08.02.1
2026.08.02.1
Changed: Bump @webframp/aws/bedrock-usage 2026.07.29.1 → 2026.08.01.1
2026.07.31.2
Changed: Breaking schema change — the hint string field in status and
report coverage entries is replaced by a setup object containing command,
permissions (array of least-privilege IAM/RBAC permissions), and authNotes
(authentication mechanism description). Consumers parsing the status resource
must update to the new shape.
Changed: The extensionType field is now included in provider status
entries (e.g. @webframp/aws/bedrock-usage).
Added: Setup guidance now includes the full model create command with all
required arguments (including auth credentials for GCP and Azure that were
previously missing), the exact permissions needed, and a description of how
authentication works for each provider.
Added: Data-driven provider registry. Adding a new provider (Anthropic, Moonshot, etc.) requires only appending a ProviderDefinition object — no new code blocks in status, generate, or the report.
Changed: The report extension now imports provider definitions from the model, eliminating duplicated per-provider rendering logic.
Upgrade note: This is a breaking change. If you parse the status resource
programmatically, update from provider.hint (string) to provider.setup
(object with command, permissions, authNotes fields). Configured providers
have these fields blanked (empty string / empty array).
| Argument | Type | Description |
|---|---|---|
| days | number | Expected lookback period |
Resources
Scan AI token usage across all configured cloud providers (AWS Bedrock, GCP Vertex AI, Azure OpenAI) and generate a unified cross-provider report. Gracefully handles missing providers — unconfigured provider steps fail silently (allowFailure: true) and the report shows coverage gaps with setup hints.
Cross-provider AI token usage report with coverage status, per-provider breakdown, and highlights
2026.08.02.1
Changed: Bump @webframp/aws/bedrock-usage 2026.07.29.1 → 2026.08.01.1
2026.07.31.2
Changed: Breaking schema change — the hint string field in status and
report coverage entries is replaced by a setup object containing command,
permissions (array of least-privilege IAM/RBAC permissions), and authNotes
(authentication mechanism description). Consumers parsing the status resource
must update to the new shape.
Changed: The extensionType field is now included in provider status
entries (e.g. @webframp/aws/bedrock-usage).
Added: Setup guidance now includes the full model create command with all
required arguments (including auth credentials for GCP and Azure that were
previously missing), the exact permissions needed, and a description of how
authentication works for each provider.
Added: Data-driven provider registry. Adding a new provider (Anthropic, Moonshot, etc.) requires only appending a ProviderDefinition object — no new code blocks in status, generate, or the report.
Changed: The report extension now imports provider definitions from the model, eliminating duplicated per-provider rendering logic.
Upgrade note: This is a breaking change. If you parse the status resource
programmatically, update from provider.hint (string) to provider.setup
(object with command, permissions, authNotes fields). Configured providers
have these fields blanked (empty string / empty array).
updated dependencies
2026.07.31.2
Changed: Breaking schema change — the hint string field in status and
report coverage entries is replaced by a setup object containing command,
permissions (array of least-privilege IAM/RBAC permissions), and authNotes
(authentication mechanism description). Consumers parsing the status resource
must update to the new shape.
Changed: The extensionType field is now included in provider status
entries (e.g. @webframp/aws/bedrock-usage).
Added: Setup guidance now includes the full model create command with all
required arguments (including auth credentials for GCP and Azure that were
previously missing), the exact permissions needed, and a description of how
authentication works for each provider.
Added: Data-driven provider registry. Adding a new provider (Anthropic, Moonshot, etc.) requires only appending a ProviderDefinition object — no new code blocks in status, generate, or the report.
Changed: The report extension now imports provider definitions from the model, eliminating duplicated per-provider rendering logic.
Upgrade note: This is a breaking change. If you parse the status resource
programmatically, update from provider.hint (string) to provider.setup
(object with command, permissions, authNotes fields). Configured providers
have these fields blanked (empty string / empty array).
updated dependencies
2026.07.24.1
Changed: Bump dependency pins to latest published versions:
- @webframp/aws/bedrock-usage 2026.07.18.1 → 2026.07.21.1
- @webframp/gcp/vertex-usage 2026.07.10.1 → 2026.07.21.1
- @webframp/azure/openai-usage 2026.06.21.1 → 2026.07.21.1
updated dependencies
2026.07.20.1
Changed: Refreshed dependency pins to the latest published releases. Model version bumped to match the manifest; no schema changes (identity upgrade).
Upgrade note: Bumps @webframp/aws/bedrock-usage 2026.05.12.1 →
2026.07.18.1, @webframp/gcp/vertex-usage 2026.05.12.1 → 2026.07.10.1, and
@webframp/azure/openai-usage 2026.05.12.1 → 2026.06.21.1, pulled automatically
with this extension.
updated dependencies
2026.07.18.1
Added: An upgrades array entry (no-op) to ai_usage.ts for proper typeVersion tracking on existing instances. No schema or behavior changes.
2026.07.16.1
Changed: README and LICENSE reformatted (deno fmt) in PR #134; this is the first version bump to publish that formatting to the registry. No functional or behavioral change.
2026.07.16.1
Changed: README and LICENSE reformatted (deno fmt) in PR #134; this is the first version bump to publish that formatting to the registry. No functional or behavioral change.
- 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