[BUG] Bedrock application inference profile ARNs not mapped to internal Anthropic model IDs, breaking model-dependent features

Resolved 💬 5 comments Opened Feb 23, 2026 by FutureGadget Closed Apr 3, 2026

Preflight Checklist

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

What's Wrong?

When using AWS Bedrock with application inference profile ARNs (e.g., arn:aws:bedrock:<region>:<account>:application-inference-profile/<id>), Claude Code does not map these custom ARNs to the corresponding internal Anthropic model ID. The ARN is treated as an opaque string, which causes:

  1. Cost CalculationmodelUsage always reports the same model ARN regardless of which model was actually requested. Cost is nearly identical across all models (~$0.22-0.23 for a "say hello" prompt), when Haiku should be dramatically cheaper than Opus. This affects /cost, statusline cost display, and OpenTelemetry metrics.
  2. Adaptive Thinking — Only the Claude 4.6 family supports this. Without resolving the ARN, Claude Code cannot determine whether to enable it.
  3. Beta Headers — Some beta headers are model-specific. Without knowing the actual model behind an ARN, incorrect headers may be sent or required ones omitted.
  4. /model Command — Custom model ARNs need to be mapped 1:1 to Anthropic's selectable model IDs. The model picker cannot correctly identify or display these models.

What Should Happen?

What Should Happen?

Claude Code should resolve Bedrock application inference profile ARNs to their corresponding internal Anthropic model IDs, so all model-dependent features (cost calculation, adaptive thinking, beta headers, model picker, etc.) work correctly.

Error Messages/Logs

All models report the same modelUsage key (Opus 4.6 ARN), regardless of which model was requested:

"modelUsage": {
  "arn:aws:bedrock:ap-northeast-2:477928018413:application-inference-profile/r7rhmi9b01o7": {
    "inputTokens": 3,
    "outputTokens": 12,
    "cacheReadInputTokens": 0,
    "cacheCreationInputTokens": 37604,
    "costUSD": 0.23534
  }
}

Error Messages/Logs

Steps to Reproduce

  1. Configure Claude Code for AWS Bedrock:

``bash
# In ~/.claude/settings.json env:
CLAUDE_CODE_USE_BEDROCK=1
AWS_REGION=ap-northeast-2
``

  1. Set up multiple application inference profile ARNs pointing to different models (Sonnet 4.6, Sonnet 4.5, Haiku 4.5, Opus 4.6).
  1. Run Claude Code with each ARN and compare the JSON output:

```bash
# Test with Sonnet 4.6 ARN
ANTHROPIC_MODEL="arn:aws:bedrock:ap-northeast-2:<account>:application-inference-profile/<sonnet-46-id>" \
claude -p "say hello" --output-format json

# Test with Haiku 4.5 ARN
ANTHROPIC_MODEL="arn:aws:bedrock:ap-northeast-2:<account>:application-inference-profile/<haiku-45-id>" \
claude -p "say hello" --output-format json

# Test with Opus 4.6 ARN
ANTHROPIC_MODEL="arn:aws:bedrock:ap-northeast-2:<account>:application-inference-profile/<opus-46-id>" \
claude -p "say hello" --output-format json
```

  1. Compare modelUsage and total_cost_usd fields:

| Requested Model | modelUsage key | total_cost_usd | cache_creation tokens |
|---|---|---|---|
| Sonnet 4.6 ARN | Opus 4.6 ARN | $0.2353 | 37,604 |
| Sonnet 4.5 ARN | Opus 4.6 ARN | $0.2353 | 37,604 |
| Haiku 4.5 ARN | Opus 4.6 ARN | $0.2227 | 35,588 |
| Opus 4.6 ARN | Opus 4.6 ARN | $0.2353 | 37,604 |

All models report Opus 4.6 ARN in modelUsage with nearly identical cost.

Claude Model

Other

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.50

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

The core issue is the lack of a bidirectional mapping between Bedrock application inference profile ARNs and Anthropic's canonical model IDs.

A possible solution would be a model resolver that:

  • Accepts an ARN as input
  • Queries or infers the underlying Anthropic model family (e.g., via ARN structure, API metadata, or a user-provided mapping)
  • Exposes the resolved canonical model ID to all internal subsystems

This would ensure all model-dependent behavior works consistently across direct API, standard Bedrock model IDs, and custom application inference profile ARNs.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗