claude-code - 💡(How to fix) Fix 2.1.94 regression: AWS_BEARER_TOKEN_BEDROCK auth header not sent to 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#45004Fetched 2026-04-09 08:15:38
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
8
Timeline (top)
labeled ×7commented ×1cross-referenced ×1

AWS_BEARER_TOKEN_BEDROCK authentication is broken in Claude Code 2.1.94. The bearer token is not attached as an Authorization header when making requests to Amazon Bedrock. Version 2.1.92 works correctly with the same environment and configuration.

Error Message

[ERROR] API error (attempt 1/11): 403 403 {"Message":"Authorization header is missing"}

Root Cause

AWS_BEARER_TOKEN_BEDROCK authentication is broken in Claude Code 2.1.94. The bearer token is not attached as an Authorization header when making requests to Amazon Bedrock. Version 2.1.92 works correctly with the same environment and configuration.

Fix Action

Workaround

Pin to version 2.1.92 by running the binary directly:

/path/to/.local/share/claude/versions/2.1.92

Or create a wrapper script earlier in PATH that points to 2.1.92.

Code Example

CLAUDE_CODE_USE_BEDROCK=1
AWS_REGION=eu-west-1
AWS_BEARER_TOKEN_BEDROCK=<valid token>
ANTHROPIC_MODEL=eu.anthropic.claude-opus-4-6-v1

---

[DEBUG] [API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: false, has Authorization header: false
[DEBUG] [API:auth] OAuth token check starting
[DEBUG] [API:auth] OAuth token check complete
[DEBUG] [API REQUEST] /model/eu.anthropic.claude-opus-4-6-v1/invoke-with-response-stream source=repl_main_thread
[ERROR] API error (attempt 1/11): 403 403 {"Message":"Authorization header is missing"}

---

/path/to/.local/share/claude/versions/2.1.92
RAW_BUFFERClick to expand / collapse

Description

AWS_BEARER_TOKEN_BEDROCK authentication is broken in Claude Code 2.1.94. The bearer token is not attached as an Authorization header when making requests to Amazon Bedrock. Version 2.1.92 works correctly with the same environment and configuration.

Environment

  • OS: macOS (Darwin 25.3.0, arm64)
  • Claude Code 2.1.94: broken
  • Claude Code 2.1.92: works
  • Auth method: AWS_BEARER_TOKEN_BEDROCK (Bedrock API key)
  • Provider: Amazon Bedrock (not Mantle)

Environment variables

CLAUDE_CODE_USE_BEDROCK=1
AWS_REGION=eu-west-1
AWS_BEARER_TOKEN_BEDROCK=<valid token>
ANTHROPIC_MODEL=eu.anthropic.claude-opus-4-6-v1

CLAUDE_CODE_USE_MANTLE is not set.

Steps to reproduce

  1. Set the environment variables above with a valid Bedrock API key
  2. Run claude (v2.1.94)
  3. Send any message
  4. All requests fail with 403 {"Message":"Authorization header is missing"}

Debug log evidence (2.1.94)

[DEBUG] [API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: false, has Authorization header: false
[DEBUG] [API:auth] OAuth token check starting
[DEBUG] [API:auth] OAuth token check complete
[DEBUG] [API REQUEST] /model/eu.anthropic.claude-opus-4-6-v1/invoke-with-response-stream source=repl_main_thread
[ERROR] API error (attempt 1/11): 403 403 {"Message":"Authorization header is missing"}

The key line is has Authorization header: false — the client is not picking up AWS_BEARER_TOKEN_BEDROCK at all.

Verified via process inspection

Both 2.1.92 (working) and 2.1.94 (broken) were started from the same terminal session with identical environment variables. Confirmed via ps -E:

  • PID running 2.1.92: has Authorization header not logged (requests succeed)
  • PID running 2.1.94: has Authorization header: false (all requests fail with 403)

Additional observations

  • Setting ANTHROPIC_CUSTOM_HEADERS="Authorization: Bearer $AWS_BEARER_TOKEN_BEDROCK" makes the debug log show has Authorization header: true, but requests still return 403. This suggests the header format or signing may have changed.
  • The word "bedrock" does not appear anywhere in the 2.1.94 debug logs, suggesting the Bedrock credential path is not being activated.
  • No other environment changes between versions — same shell, same token, same region.

Workaround

Pin to version 2.1.92 by running the binary directly:

/path/to/.local/share/claude/versions/2.1.92

Or create a wrapper script earlier in PATH that points to 2.1.92.

extent analysis

TL;DR

The most likely fix is to revert to Claude Code version 2.1.92, as it works correctly with the same environment and configuration.

Guidance

  • Verify that the AWS_BEARER_TOKEN_BEDROCK environment variable is set and valid.
  • Check the debug logs for any differences in authentication header handling between versions 2.1.92 and 2.1.94.
  • Consider setting ANTHROPIC_CUSTOM_HEADERS to include the Authorization header, but be aware that this may not work due to potential changes in header format or signing.
  • Pin to version 2.1.92 as a temporary workaround by running the binary directly or creating a wrapper script.

Example

To set ANTHROPIC_CUSTOM_HEADERS, you can use the following command:

ANTHROPIC_CUSTOM_HEADERS="Authorization: Bearer $AWS_BEARER_TOKEN_BEDROCK"

However, as noted in the issue, this may not resolve the issue due to potential changes in header format or signing.

Notes

The issue suggests that the Bedrock credential path is not being activated in version 2.1.94, which may indicate a change in the authentication mechanism. Further investigation is needed to determine the root cause of the issue.

Recommendation

Apply the workaround by pinning to version 2.1.92, as it is the most straightforward solution to resolve the authentication issue. This will allow you to continue using the AWS_BEARER_TOKEN_BEDROCK authentication method until a fix is available for version 2.1.94.

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