Support Amazon Bedrock API Keys
Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 7 comments · opened Jul 10, 2025 · closed Jul 14, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator)
responded on this thread — see the highlighted reply below.
AWS recently launched API keys for Amazon Bedrock (announced July 8, 2025), offering a much simpler authentication method than the current IAM role setup.
We propose adding support for these API keys to streamline the initial configuration for claude-code users on AWS. This would significantly improve the developer experience by providing a straightforward alternative to manual IAM policy and principal configuration.
Suggested Implementation
Support could be implemented by having claude-code recognize and use a new environment variable containing the Bedrock API key. The AWS SDK for Python (Boto3) can automatically use the AWS_BEARER_TOKEN_BEDROCK environment variable to authenticate.
For example:
import boto3
# Boto3 client automatically uses the key set in the environment variable:
# export AWS_BEARER_TOKEN_BEDROCK=${your-bedrock-api-key}
client = boto3.client(
service_name="bedrock-runtime",
region_name="us-east-1"
)
response = client.converse(
modelId="us.anthropic.claude-3-5-haiku-20241022-v1:0",
messages=[{"role": "user", "content": [{"text": "Hello"}]}],
)
print(response['output']['message']['content'][0]['text'])
7 Comments
This is shipping in upcoming release
1.0.49, via theAWS_BEARER_TOKEN_BEDROCKenv var!Great to hear!
I see this has now been released. Can't seem to make it work though. Does this environment variable need to be called with any others?
I've tried
CLAUDE_CODE_USE_BEDROCKandAWS_REGION.Hey, were you able to get the API Key system working?
Here's how I did it; it might help you:
1. I created a settings.json file in /home/myuser/.claude:
2. My permanent bash variables (.zshrc or .bashrc`):
Try this out and see if it works.
I'm not sure which of these settings is redundant, but this is what worked for me. It's worth testing.
I personally had an issue where my API key only had access to one region, so needed to make it was aligned with the Claude Code
AWS_REGION.Closing this issue - feel free to comment if you're running into issues with this!
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.