As 2025 draws to a close, the AI race is still not showing any signs of slowing down. We have new foundational models coming out between OpenAI, Anthropic, and Google to name a few, and every day, there's yet another strategic partnership being announced by major players up and down the stack.
It's interesting to take a look at what the major hyperscalers have done with AI. Google of course has their own model (i.e., Gemini) as well as significant investments in infrastructure with TPU chips. Microsoft still has deep ties to OpenAI, while making new agreements to expand their offerings. Until recently, Amazon was lagging in the AI race besides their initial deal with Anthropic in 2023 and investments in Trainium chips.
But with Anthropic forming a new partnership with Microsoft and OpenAI in talks with Amazon about investment, exclusive access is looking like a thing of the past. This puts AWS in an interesting position as it can leverage its lead in the cloud space to offer the latest AI models and features to its customers.
In this blog post, we'll quickly go over how to setup Anthropic models with AWS Bedrock and configure Claude VSCode extension to go through AWS Bedrock.
But why?
You might be wondering why someone would go through AWS Bedrock instead of going directly to Anthropic. For personal use, getting a Pro or Max plan is likely the cheaper and easier route. However, for enterprise use cases, leveraging existing AWS infrastructure is often easier in terms of compliance, security, and billing. Also, unless you are a large enterprise customer, establishing an enterprise relationship with Anthropic is a slow process at the moment as they scale up.
Setting up AWS Bedrock
Setting up AWS Bedrock to use Anthropic's models is straight forward. Navigate to AWS Bedrock via the Console. Previously, you needed to enable specific models under Configure and learn > Model access, but now foundational models are automatically enabled when first invoked. Instead, jump to Chat / Text playground and select any Anthropic models like Sonnet 4.5.
Anthropic requires first-time users to submit a use case form. Fill out the form, and you should promptly get an email from AWS confirming AWS Marketplace subscription for the model you chose. Subsequent models that are selected will be automatically enabled without having to submit another form.
Configuring AWS credentials for Claude Code
Now that Anthropic models are enabled, we just need to configure AWS credentials for Claude Code. Since Claude Code uses the default AWS SDK credentials, we can leverage existing methods to authenticate with AWS (as long as we have IAM permissions to access Bedrock).
Option A: AWS CLI configuration
aws configure
Option B: Environment variables (access key)
export AWS_ACCESS_KEY_ID=your-access-key-id
export AWS_SECRET_ACCESS_KEY=your-secret-access-key
export AWS_SESSION_TOKEN=your-session-token
Option C: Environment variables (SSO profile)
aws sso login --profile=<your-profile-name>
export AWS_PROFILE=your-profile-name
The other option is to leverage Bedrock API keys to authenticate directly with Bedrock. To generate an API key, navigate back to AWS Bedrock console and select API keys. Then you can generate a short-term or long-term API keys with desired expiration time.
Finally, you need to set two environment variables to let Claude Code know you want to authenticate with Bedrock instead of going directly to Anthropic:
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1
You can set other environment variables like models or disable caching like:
# Using inference profile ID
export ANTHROPIC_MODEL='global.anthropic.claude-sonnet-4-5-20250929-v1:0'
export ANTHROPIC_SMALL_FAST_MODEL='us.anthropic.claude-haiku-4-5-20251001-v1:0'
# Using application inference profile ARN
export ANTHROPIC_MODEL='arn:aws:bedrock:us-east-2:your-account-id:application-inference-profile/your-model-id'
# Optional: Disable prompt caching if needed
export DISABLE_PROMPT_CACHING=1
Setting up VS Code Plugin
At this point, you can use Claude Code with Bedrock in any terminal shell. However, since VS Code plugin launches its own shell, we need to configure VS Code to let the Claude Code extension know where to pull the right credentials.
To enable this, open VS Code, and type Preferences: Open User Settings (JSON) via the command palette (either Ctrl+Shift+P or Cmd+Shift+P on Windows or Mac).
Depending on your previous interactions with the Claude Code extension, there may already be some claudeCode related settings (e.g., selected model). The crucial part here is to add claudeCode.environmentVariables in an array like:
"claudeCode.environmentVariables": [
{
"name": "AWS_PROFILE",
"value": "AWS_PROFILE_NAME"
},
{
"name": "AWS_REGION",
"value": "us-east-1"
},
{
"name": "CLAUDE_CODE_USE_BEDROCK",
"value": "1"
}
]
You can add other environment variables or use your preferred authentication method (including the API keys) there. Once configured, reload VS Code and relaunch the Claude Code extension.
Now you're ready to use Claude Code without being prompted a login:


Top comments (0)