anomalyco / anomalyco/opencode
AWS Bedrock "Message":"Authentication failed: Please make sure your API Key is valid."
@jlongster is already working on this.
Since Sep 3, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
I had an API key I worked with before expire, and when I started up, I looked at it, went, hmm, I probably need a new one, and did that.
I followed the correct advice to create a new token, add it to my shell, reset the shell and launch opencode, which had updated.
I'm still getting the error with the new token, while
curl -X POST "https://bedrock-runtime.us-east-1.amazonaws.com/model/us.anthropic.claude-sonnet-4-6/converse" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AWS_BEARER_TOKEN_BEDROCK" \
-d '{
"messages": [{"role": "user", "content": [{"text": "Hello"}]}]
}'
produces a clear response, implying there's something wrong in opencode itself, NOT my token.
Plugins
No response
OpenCode version
1.18.27
Steps to reproduce
Start with an invalid AWS Bedrock token
Select AWS Bedrock GLM-5 model
Send a request.
Fail
Replace the token with a valid one and add to the shell (or export directly to the terminal, either fails)
Restart opencode
Send a request
Fail
Screenshot and/or share link
No response
Operating System
MacOS
Terminal
ZSH in VSCode Terminal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.