Skip to content

feat: add AWS Bedrock in-region Claude pricing - #95

Merged
Carl723000 merged 1 commit into
ClaudeCodeUsage:mainfrom
akapti:feat/aws-bedrock-claude-pricing
Sep 6, 2026
Merged

Carl723000 merged 1 commit into
ClaudeCodeUsage:mainfrom
akapti:feat/aws-bedrock-claude-pricing

Conversation

@akapti

@akapti akapti commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds selectable AWS Bedrock in-region pricing for Claude Code usage and keeps cached aggregates consistent when pricing changes.

Added Bedrock model rates

  • Claude Opus 4.5, 4.6, 4.7, and 4.8
  • Claude Sonnet 4.5 and 4.6
  • Existing Claude Opus 5, Sonnet 5, and Haiku 4.5 Bedrock rates retained
  • Separate 5-minute and 1-hour cache-write rates
  • Regional Bedrock model IDs such as us.anthropic.* are recognized
  • Direct Anthropic pricing remains the default; AWS Bedrock pricing is opt-in through the Claude settings panel

Model-ID handling

  • Normalizes dated Claude model IDs such as claude-sonnet-4-5-20250929
  • Handles Bedrock inference-profile prefixes such as us.anthropic.*
  • Treats dotted and underscored model labels consistently with native hyphenated Claude IDs
  • Prevents Sonnet 4.5 Bedrock usage from falling back to direct Anthropic rates

Cache correctness

Changing the pricing backend now invalidates the incremental Claude usage index so totalCost, model totals, and cost breakdowns are recalculated immediately. The same invalidation is applied after refreshing token pricing.

UI changes

  • Added the Claude pricing backend dropdown to the Claude Settings panel
  • Provides Anthropic direct API and AWS Bedrock (in-region) options
  • Keeps the Bedrock pricing control scoped to Claude and hidden from Codex settings
  • Selecting the Bedrock option sends the expected updateSetting message to the extension host

Tests and validation

  • npm run test:release
  • Node suite: 617 passed, 1 skipped
  • Playwright UI suite: 65 passed
  • Added focused pricing coverage for the requested Opus and Sonnet model families
  • Added UI coverage for dropdown visibility, provider scoping, option labels, default selection, and Bedrock selection messaging
  • Verified the packaged VSIX and local installation separately as version 2.3.1

The Bedrock mode remains opt-in; direct Anthropic pricing remains the default.

@github-actions github-actions Bot added the feature Minor bump — new feature label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

🤖 Automated first-pass review

The configured analysis model did not return a usable analysis for this pull request. The item has still been received and remains available for maintainer review.

To help with review, please ensure the change summary, tests, and any user-facing documentation or localization updates are included.


🤖 Posted automatically by CCU Bot — not a maintainer decision.

@akapti
akapti force-pushed the feat/aws-bedrock-claude-pricing branch from 6c3930c to 6452ae8 Compare September 4, 2026 20:27
@akapti
akapti force-pushed the feat/aws-bedrock-claude-pricing branch from 6452ae8 to ae255cd Compare September 4, 2026 20:32
@Carl723000
Carl723000 merged commit 694eef1 into ClaudeCodeUsage:main Sep 6, 2026
4 checks passed
@akapti
akapti deleted the feat/aws-bedrock-claude-pricing branch September 7, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Minor bump — new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants