Skip to content

Incorrect "API Usage Billing" banner when using AWS Bedrock #57812

Closed

Description

@mandloils

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

Activity

  1. github-actions commented on May 10, 2026

    @github-actions

    Found 1 possible duplicate issue:

    1. [BUG] Misleading 'API Usage Billing' label when using Bedrock via settings.json env block #54707

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. github-actions commented on Jul 1, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  3. locked as resolved and limited conversation to collaborators on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api:bedrockIssue relates to AWS Bedrockarea:tuibugSomething isn't workingplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions