There are some environment variables you can set to use Bedrock for your session to force Claude Code to use Bedrock.
export CLAUDE_CODE_USE_BEDROCK=1
export ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0'
You can also use claude config to set Bedrock as the default provider.
claude config set --global env '{"CLAUDE_CODE_USE_BEDROCK": "true", "ANTHROPIC_MODEL": "us.anthropic.claude-3-7-sonnet-20250219-v1:0"}
Answer from wonton on Stack OverflowAWS
docs.aws.amazon.com › amazon bedrock › user guide › amazon bedrock foundation model information › inference request parameters and response fields for foundation models › anthropic claude models › anthropic claude messages api
Anthropic Claude Messages API - Amazon Bedrock
This topic shows how to use the Anthropic Claude messages API with the base inference operations (InvokeModel or InvokeModelWithResponseStream). However, we recommend that you use the Converse API to implement messages in your application. The Converse API provides a unified set of parameters that work across all models that support messages.
AWS
docs.aws.amazon.com › amazon bedrock › user guide › amazon bedrock foundation model information › inference request parameters and response fields for foundation models › anthropic claude models
Anthropic Claude models - Amazon Bedrock
You can use Amazon Bedrock to send Anthropic Claude Text Completions API or Anthropic Claude Messages API inference requests.
Videos
27:16
Building AI agents with Claude in Amazon Bedrock | Code w/ Claude ...
08:12
How-To Use Claude 3.7 Sonnet in Amazon Bedrock - YouTube
09:10
How to Use Claude 3 with Amazon Bedrock - YouTube
10:32
How to Use Claude 3 Haiku Locally Using Amazon Bedrock in Boto3 ...
05:18
Claude API on AWS Bedrock - YouTube
27:42
Mastering Amazon Bedrock with Claude 3: Developer's Guide with ...
Claude
code.claude.com › docs › en › amazon-bedrock
Claude Code on Amazon Bedrock - Claude Code Docs
Specify the model as an inference profile ID Claude Code uses the Bedrock Invoke API and does not support the Converse API.
AWS
docs.aws.amazon.com › amazon bedrock › user guide › code examples for amazon bedrock using aws sdks › code examples for amazon bedrock runtime using aws sdks › anthropic claude for amazon bedrock runtime › invoke anthropic claude on amazon bedrock using the invoke model api
Invoke Anthropic Claude on Amazon Bedrock using the Invoke Model API - Amazon Bedrock
# Use the native inference API to send a text message to Anthropic Claude. import boto3 import json from botocore.exceptions import ClientError # Create a Bedrock Runtime client in the AWS Region of your choice. client = boto3.client("bedrock-runtime", region_name="us-east-1") # Set the model ID, e.g., Claude 3 Haiku.
Reddit
reddit.com › r/aws › claude code with aws bedrock api key
r/aws on Reddit: Claude code with AWS Bedrock API key
March 20, 2025 -
Has anyone able to figure out how to set this up? Tried the bellow steps with no luck... On start it still directs to anthropic console for apikey
https://community.aws/content/2tXkZKrZzlrlu0KfH8gST5Dkppq/claude-code-on-amazon-bedrock-quick-setup-guide?lang=en
DEV Community
dev.to › yitaek › setting-up-aws-bedrock-with-claude-5f67
Setting up AWS Bedrock with Claude - DEV Community
2 days ago - 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). ... 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 ... The other option is to leverage Bedrock API keys to authenticate directly with Bedrock.
Medium
medium.com › @hannah.hj.do › how-to-access-claude-2-1-via-aws-bedrock-3e322cfe107e
How to access Claude-2.1 via AWS Bedrock | by Hannah Do | Medium
March 16, 2024 - AWS Bedrock service wasn’t yet opened in Seoul region so I switched Tokyo region (ap-northeast-1) and submitted API request. The request was approved in only few minutes! ... Excited to test out the results, I created a new client for Claude with basic information, added boto3 to my virtual environment (poetry), updated aws cli, and stored aws account information (aws configure) on my server.
GitHub
github.com › aws-samples › function-calling-using-amazon-bedrock-anthropic-claude-3
GitHub - aws-samples/function-calling-using-amazon-bedrock-anthropic-claude-3: Function calling using Amazon Bedrock with Anthropic Claude 3 foundation model
Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models from leading AI companies and a set of capabilities to build generative AI applications. This sample repo provide an example for using function calling using the Converse API with Anthropic Claude 3 Sonnet, using multiple tools.
Starred by 37 users
Forked by 9 users
Languages Python
AWS
aws.amazon.com › blogs › aws › introducing-claude-sonnet-4-5-in-amazon-bedrock-anthropics-most-intelligent-model-best-for-coding-and-complex-agents
Introducing Claude Sonnet 4.5 in Amazon Bedrock: Anthropic’s most intelligent model, best for coding and complex agents | Amazon Web Services
September 29, 2025 - Sonnet 4.5 features in the Amazon Bedrock API Here are some highlights of Sonnet 4.5 in the Amazon Bedrock API: Smart Context Window Management – The new API introduces intelligent handling when AI models reach their maximum capacity. Instead of returning errors when conversations get too long, Claude Sonnet 4.5 will now generate responses up to the available limit and clearly indicate why it stopped.
Claude
docs.claude.com › en › docs › build-with-claude › claude-on-amazon-bedrock
Claude on Amazon Bedrock - Claude Docs
For full control without forced citations, use the InvokeModel API For more details on the two document processing modes and their limitations, refer to the PDF support guide. Claude Sonnet 4 and 4.5 support the 1M token context window on Amazon Bedrock.
Samuelliedtke
samuelliedtke.com › blog › accessing-anthropic-claude-via-api-individual
Using Anthropic Claude with llm via AWS Bedrock | Samuel Liedtke
export AWS_DEFAULT_REGION=us-east-1 export AWS_PROFILE=bedrock-api · Request access to the models from the AWS Bedrock console. ... # list available models aws bedrock list-foundation-models # use claude haiku (can also use alias `bh`) llm -m anthropic.claude-3-haiku-20240307-v1:0 -s \ "ten names for a pet octopus"
AWS re:Post
repost.aws › questions › QUSd3wAByQTtyzUPzgqss3TQ › web-search-for-anthropic-models-in-bedrock
Web Search for Anthropic Models in Bedrock | AWS re:Post
May 7, 2025 - As of the latest available information, Amazon Bedrock does not directly support the web_search tool for Anthropic models through the Converse API in the way you've described. However, Amazon Bedrock does offer a way to integrate web search capabilities with Anthropic models, including Claude 3.7 Sonnet, through Amazon Bedrock Agents.