[BUG] Anthropic API Error: API Key was rejected with Bedrock Bearer Token
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?
Bug Description
All of a sudden I've started getting a "API Key was rejected" error when using a Bedrock Bearer Token.
IMPORTANT Note - When I try to login with Amazon CLI configured env vars, it was not working for the past 2 hours - and all of a sudden it is now working for AWS CLI configured env vars for the same user. It still fails for Bedrock Bearer Token.
Side note - I just setup openclaw on my system, and I think it has cause some conflict issue for env
Environment Info
Platform: Windows 11
Terminal: powershell
Version: 2.1.144 (Claude Code)
What Should Happen?
Successful authentication
Error Messages/Logs
Steps to Reproduce
API key shows:
/setup-bedrock
────────────────────────────────────────────────────────────────────────────────
Set up AWS Bedrock
Verification failed
✘ API key was rejected. Your IAM policy may be missing
bedrock:CallWithBearerToken or bedrock:InvokeModel.
❯ 1. Go back and fix
- Save anyway (skip verification)
↑↓ to navigate · Enter to select · Esc to go back
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.124
Claude Code Version
2.1.144
Platform
AWS Bedrock
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
<img width="1768" height="742" alt="Image" src="https://github.com/user-attachments/assets/5be06829-8620-4039-b8a0-4981cfa063eb" />
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗