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 OverflowVideos
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
Hi all,
I'm currently running into rate limit challenges with multiple Claude Pro subscriptions (using Claude 3.5 Sonnet primarily for coding tasks). I'm considering switching to an API-based solution and would appreciate insights on choosing between Anthropic's direct API and Claude models hosted on Amazon Bedrock.
Key questions I'm trying to understand:
Rate Limits & Capacity
How do the rate limits and token quotas compare between Anthropic's direct API and Claude on Amazon Bedrock (specifically for Claude 3.5 Sonnet)?
I've heard Anthropic's direct API has stricter limits than their subscription service - is this accurate?
Performance Metrics
What are the differences in latency and token generation speed between the two platforms?
Are there any notable performance advantages to either option?
Tier Upgrades & Limits
What's involved in getting approved for higher usage tiers on each platform?
How do their respective approval processes compare?
Cost Structure
While pricing isn't a major factor for my personal use case, I'd like to understand the cost differences
Are there any hidden costs or considerations I should be aware of?
Any insights on these points would be valuable, even if you can only speak to some aspects of the comparison. Thank you for your help!