claude-code - 💡(How to fix) Fix Incorrect "API Usage Billing" banner when using AWS Bedrock [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#57812Fetched 2026-05-11 03:24:44
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

Claude Code displays "API Usage Billing" in the banner when configured to use AWS Bedrock, which is misleading. Users configured for Bedrock should see "AWS Bedrock Billing" or similar.

Error Message

Error Messages/Logs

No error messages. This is a UI display issue.

Root Cause

This is misleading because:

  1. User is NOT billed via Anthropic API
  2. Billing goes through AWS Bedrock account
  3. Costs appear on AWS bill, not Anthropic invoice

Fix Action

Fix / Workaround

Workaround: Users can verify actual billing via AWS Console → Bedrock → Usage

Code Example

{
     "env": {
       "CLAUDE_CODE_USE_BEDROCK": "1",
       "AWS_REGION": "us-east-1",
       "AWS_PROFILE": "[YOUR_PROFILE]",
       "ANTHROPIC_DEFAULT_SONNET_MODEL": "us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]"
     }
   }

---

claude

---

{
  "lastModelUsage": {
    "us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]": {
      "inputTokens": 10,
      "outputTokens": 1198,
      "cacheReadInputTokens": 0,
      "cacheCreationInputTokens": 16273,
      "costUSD": 0.079...
    }
  }
}

---

// Pseudo-code
const billingSource = process.env.CLAUDE_CODE_USE_BEDROCK === '1' 
  ? 'AWS Bedrock Billing'
  : 'API Usage Billing';

const banner = `${modelName} · ${billingSource}`;

---

Sonnet 4.5 · 🔶 AWS Bedrock
Sonnet 4.5 · 🟣 API Billing

---

// Bedrock models have format: us.anthropic.*
const isBedrock = modelId.startsWith('us.anthropic.') || 
                  modelId.startsWith('global.anthropic.');

const billingSource = isBedrock ? 'AWS Bedrock' : 'API Usage';

---

No error messages. This is a UI display issue.

Banner currently shows: "Sonnet 4.5 · API Usage Billing"
Should show: "Sonnet 4.5 · AWS Bedrock Billing"

Configuration evidence:
- CLAUDE_CODE_USE_BEDROCK=1
- Model ID: us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]
- AWS_REGION=us-east-1

---

{
     "env": {
       "CLAUDE_CODE_USE_BEDROCK": "1",
       "AWS_REGION": "us-east-1",
       "AWS_PROFILE": "[YOUR_PROFILE]"
     }
   }
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Bug Report: Incorrect "API Usage Billing" banner when using AWS Bedrock

Summary

Claude Code displays "API Usage Billing" in the banner when configured to use AWS Bedrock, which is misleading. Users configured for Bedrock should see "AWS Bedrock Billing" or similar.

Environment

  • Claude Code Version: 2.1.138 (latest)
  • OS: macOS (Darwin 25.4.0)
  • Shell: zsh
  • Install Method: global

Expected Behavior

When CLAUDE_CODE_USE_BEDROCK=1 is set, the banner should display:

  • "Sonnet 4.5 · AWS Bedrock Billing"
  • Or: "Sonnet 4.5 · Bedrock"
  • Or: "Sonnet 4.5 · Billed via AWS"

Actual Behavior

Banner displays: "Sonnet 4.5 · API Usage Billing"

This is misleading because:

  1. User is NOT billed via Anthropic API
  2. Billing goes through AWS Bedrock account
  3. Costs appear on AWS bill, not Anthropic invoice

Reproduction Steps

  1. Configure Claude Code for AWS Bedrock in ~/.claude/settings.json:

    {
      "env": {
        "CLAUDE_CODE_USE_BEDROCK": "1",
        "AWS_REGION": "us-east-1",
        "AWS_PROFILE": "[YOUR_PROFILE]",
        "ANTHROPIC_DEFAULT_SONNET_MODEL": "us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]"
      }
    }
  2. Start Claude Code CLI:

    claude
  3. Observe banner at top of terminal

Result: Banner shows "API Usage Billing" instead of "AWS Bedrock Billing"

Evidence

Claude Code correctly:

  • ✅ Uses AWS credentials (AWS_PROFILE)
  • ✅ Uses Bedrock endpoints (AWS_REGION)
  • ✅ Tracks usage with Bedrock model IDs (us.anthropic.* format)
  • ❌ Displays incorrect billing source in banner

Model usage logs show Bedrock model format:

{
  "lastModelUsage": {
    "us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]": {
      "inputTokens": 10,
      "outputTokens": 1198,
      "cacheReadInputTokens": 0,
      "cacheCreationInputTokens": 16273,
      "costUSD": 0.079...
    }
  }
}

Impact

Severity: Low (Cosmetic/Misleading)

User Impact:

  • Users may think they're being billed via Anthropic API
  • Users may look for charges on wrong billing account
  • Corporate users may have compliance concerns about billing source

Financial Impact: None (billing works correctly, only display is wrong)

Workaround: Users can verify actual billing via AWS Console → Bedrock → Usage

Suggested Fix

Option 1: Detect Bedrock and Update Banner

// Pseudo-code
const billingSource = process.env.CLAUDE_CODE_USE_BEDROCK === '1' 
  ? 'AWS Bedrock Billing'
  : 'API Usage Billing';

const banner = `${modelName} · ${billingSource}`;

Option 2: Add Billing Source Icon

Sonnet 4.5 · 🔶 AWS Bedrock
Sonnet 4.5 · 🟣 API Billing

Option 3: Detect by Model ID Format

// Bedrock models have format: us.anthropic.*
const isBedrock = modelId.startsWith('us.anthropic.') || 
                  modelId.startsWith('global.anthropic.');

const billingSource = isBedrock ? 'AWS Bedrock' : 'API Usage';

Additional Context

Bedrock Model ID Format

Bedrock uses different model ID format than API:

  • Bedrock: us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]
  • API: claude-sonnet-4-5-20250929

The model ID format can be used to auto-detect billing source.

Verification

To verify the fix:

  1. Configure Claude Code for Bedrock (as above)
  2. Start claude CLI
  3. Check banner displays "AWS Bedrock" or similar (not "API Usage")
  4. Verify API users still see "API Usage Billing" (no regression)

Labels: bug, ui, bedrock, low-priority

What Should Happen?

When CLAUDE_CODE_USE_BEDROCK=1 is configured, the banner should display "AWS Bedrock Billing" instead of "API Usage Billing" to accurately reflect that billing goes through AWS, not Anthropic's API.

Error Messages/Logs

No error messages. This is a UI display issue.

Banner currently shows: "Sonnet 4.5 · API Usage Billing"
Should show: "Sonnet 4.5 · AWS Bedrock Billing"

Configuration evidence:
- CLAUDE_CODE_USE_BEDROCK=1
- Model ID: us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]
- AWS_REGION=us-east-1

Steps to Reproduce

  1. Configure ~/.claude/settings.json with:

    {
      "env": {
        "CLAUDE_CODE_USE_BEDROCK": "1",
        "AWS_REGION": "us-east-1",
        "AWS_PROFILE": "[YOUR_PROFILE]"
      }
    }
  2. Start Claude Code CLI: claude

  3. Observe the banner at the top of the terminal

Expected: "Sonnet 4.5 · AWS Bedrock Billing" Actual: "Sonnet 4.5 · API Usage Billing"

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.138

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Incorrect "API Usage Billing" banner when using AWS Bedrock [1 comments, 2 participants]