[BUG] Authentication token header is failing again for AWS Bedrock

Status Fixed / completed
Maintainer reply ✓ Yes — mhegazy
Activity 3 comments · opened Apr 27, 2026 · closed May 5, 2026
💡 Likely answer: A maintainer (mhegazy, contributor) responded on this thread — see the highlighted reply below.

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?

I am currently using Claude Code v2.1.119 via AWS Bedrock, and when I try to send a prompt, it enters into the retry loop. All I am doing is sending a simple "hello" prompt to it.

What Should Happen?

Get a response back.

Error Messages/Logs

403 {"Message":"Authentication failed: Please make sure your API Key is valid."}

Steps to Reproduce

Run Claude Code via AWS Bedrock, set up your environment variables, on a Ubuntu 24.04 machine, start it up with claude, and then feed it a hello prompt.

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

v2.1.117

Claude Code Version

v2.1.119

Platform

AWS Bedrock

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

I remember this being a issue about a week or two back, where they mentioned that updating a aws sdk dependency bricked the Bedrock auth, which I am assuming one of the agents likely did again...

View original on GitHub ↗

3 Comments

mhegazy contributor · 5 months ago

The error message "Authentication failed: Please make sure your API Key is valid." is not a CC error message, it is what AWS Bedrock returns when an ABSK bearer token has the right format but the credentials are rejected server-side‚ i.e. expired, revoked, or scoped wrong. It is not generated by CC. so i am guessing something else is going on here.

My recommendation would be (a) regenerate/rotate their Bedrock API key in the AWS console, (b) confirm aws bedrock invoke-model works directly with the same $AWS_BEARER_TOKEN_BEDROCK from the same shell, and if that does not, please share --debug-file output showing the exact [API error] lines‚ if it differs from the curl result, then we have a CC-side bug; otherwise it's a token-validity issue.

hoo29 · 5 months ago

for us it was a missing AWS_REGION env var. Seemingly only required for invokemodelwithresponsestream, not the other bedrock apis.

github-actions[bot] · 3 months ago

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.