How to run Claude Code on Amazon Bedrock
To run Claude Code on Amazon Bedrock, first open the Amazon Bedrock console, pick an Anthropic model from the Model catalog and submit the use case form. Then run claude, select 3rd-party platform at the login prompt, choose Amazon Bedrock, and follow the wizard. It asks how you sign in to AWS, which region to use, checks which Claude models your account can call, and saves everything to your user settings, so you do not have to export environment variables yourself.
From then on, Claude Code sends every model request to Bedrock in your AWS account. You pay AWS for the tokens you use, you track the cost in AWS Cost Explorer, and your security team gets IAM policies and CloudTrail instead of a separate vendor account. Everything you already know about Claude Code, like CLAUDE.md, skills, subagents, hooks, MCP servers and checkpoints, works the same way.
Should you use Bedrock or a Claude plan?
If you are building for yourself, I would not start here. A Claude plan and the Claude Code desktop app is the easiest setup there is, and it unlocks features Bedrock cannot reach. Which Claude plan for Claude Code covers that choice. Bedrock earns its setup time when the money or the rules already live in AWS.
Claude plan vs Amazon Bedrock for Claude Code, from Anthropic's deployment docs
| Claude plan (Pro, Max, Team, Enterprise) | Amazon Bedrock | |
|---|---|---|
| Billing | Subscription, with pay as you go available on Team | Pay as you go through your AWS bill |
| Sign-in | claude.ai account | AWS credentials or an Amazon Bedrock API key |
| Cost tracking | Usage dashboard | AWS Cost Explorer |
| Audit and access | Team management, SSO, usage monitoring | IAM policies and CloudTrail |
| Where the models run | Anthropic's API | Multiple AWS regions you choose |
| Desktop app | Yes | Only through the Claude Desktop on 3P deployment mode |
- Your company already buys Claude through AWS and wants one bill.
- Your security or compliance rules say model traffic has to stay inside your AWS account and region.
- You run Claude Code in CI or on servers that already have AWS roles, so there is no extra key to manage.
Step by step: set up Claude Code on Bedrock with the wizard
- Enable an Anthropic model. In the Amazon Bedrock console, open the Model catalog, select an Anthropic model and submit the use case form. You do this once per AWS account, and the docs say access is granted right after you submit. With AWS Organizations, you can submit it once from the management account with the PutUseCaseForModelAccess API, and approval extends to child accounts.
- Start the wizard. Run claude. At the login prompt choose 3rd-party platform, then Amazon Bedrock. If you are already signed in and see the chat prompt, type /setup-bedrock in full. It stays hidden from the command menu until CLAUDE_CODE_USE_BEDROCK=1 is set.
- Pick how you sign in to AWS. The wizard offers an AWS profile it finds in your ~/.aws folder, an Amazon Bedrock API key, an access key and secret, or credentials already in your environment.
- Choose a region and pin models. The wizard checks which Claude models your account can call and lets you pin them. It writes the result to the env block of ~/.claude/settings.json.
- Check it. Run /status inside Claude Code to see the provider and the region it resolved.
Run /setup-bedrock again any time to change your credentials, region or pinned models. Because Bedrock handles sign-in through AWS, /logout does nothing here.
Which AWS sign-in to use
Claude Code uses the standard AWS credential chain, so if a machine already has credentials, such as an EC2 instance profile or ECS task credentials, it just works. For your own laptop, the docs list these options.
AWS credential options Claude Code supports on Bedrock
| Method | How | Good for |
|---|---|---|
| SSO profile | aws sso login --profile your-profile, then set AWS_PROFILE | Companies that use IAM Identity Center |
| Console sign-in | aws login, which needs AWS CLI 2.32.0 or later. Sessions last up to 12 hours | Signing in through the browser with your console credentials |
| Amazon Bedrock API key | Set AWS_BEARER_TOKEN_BEDROCK. Short-term keys last up to 12 hours | A token that only works for Bedrock |
| aws configure or exported keys | Saves or exports an IAM user's access key | Quick tests. AWS warns against IAM user keys for real work |
If you use SSO, add an awsAuthRefresh setting such as "aws sso login --profile myprofile" to your settings file. Claude Code runs it only when your credentials have actually expired, then retries the request. If browser tabs keep opening in a loop behind a corporate VPN or proxy, remove that setting and run aws sso login yourself before you start Claude Code.
Pin your models before you roll it out
This is the step I would not skip. Without a pin, aliases like opus and sonnet resolve to Claude Code's built-in default for Bedrock, which can lag the newest release or not be enabled in your account. The docs also warn that if you do not pin a primary model, it defaults to an Opus model and you are billed at the Opus rate, which is higher per token than Sonnet.
- Pin each family with ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL, set to Bedrock model IDs such as us.anthropic.claude-sonnet-4-6. The us. prefix is a cross-region inference profile. EU regions use eu., Asia Pacific uses apac., and GovCloud uses us-gov.
- To make Sonnet the default instead of Opus, set ANTHROPIC_MODEL to the full Sonnet model ID.
- When an unpinned default is not available in your account, Claude Code falls back to an earlier or lower-tier model for that session and shows a notice. A pin makes the choice permanent.
Model choice is the biggest lever on what Claude Code costs, on any provider. How much Claude Code costs per month breaks that down, and Claude Code environment variables covers where to set these so they stick.
The IAM policy Claude Code needs
The role or user Claude Code runs as needs four Bedrock actions: bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream, bedrock:ListInferenceProfiles and bedrock:GetInferenceProfile, on inference profile, application inference profile and foundation model resources. The docs example also allows aws-marketplace:ViewSubscriptions and aws-marketplace:Subscribe, limited to calls made through Bedrock. You can narrow the resources to specific inference profile ARNs.
- Use a separate AWS account. Anthropic's docs suggest a dedicated account for Claude Code to make cost tracking and access control simpler.
- Add content filtering if you need it. Amazon Bedrock Guardrails work with Claude Code through the ANTHROPIC_CUSTOM_HEADERS setting, using your guardrail ID and version.
- Lock the provider on company machines. The allowedProviders managed setting can allow Bedrock and nothing else. It needs Claude Code v2.1.285 or later.
What you give up on Bedrock
Bedrock runs the core of Claude Code, but some features need a claude.ai sign-in. Here is what the feature availability docs list, and the workaround where one exists.
Claude Code features not available on Amazon Bedrock
| Not available | Use instead |
|---|---|
| Web search | WebFetch with a specific URL |
| Cloud scheduled tasks (/schedule) | /loop, which runs on your machine |
| Cloud sessions and Claude Code on mobile | GitHub Actions or GitLab CI/CD |
| Remote Control, Chrome extension, computer use, voice | No direct replacement |
| Fast mode, Advisor, Channels, server-managed settings | No direct replacement |
| The standard desktop app | Claude Desktop on 3P, a deployment mode that runs the Code tab on Bedrock |
Auto mode works on Bedrock only with certain newer models, and error reporting and telemetry to Anthropic are off by default. If you need CI instead of cloud sessions, Claude Code GitHub Actions and Claude Code in GitLab CI/CD both support Bedrock.
Fixes for common Bedrock errors
- "on-demand throughput isn't supported": set the model to an inference profile ID, such as one starting with us., instead of the bare model ID.
- Region problems: run aws bedrock list-inference-profiles --region your-region to see what your account can use, or set AWS_REGION to a supported region.
- Credentials hang at startup: the credential lookup times out after 60 seconds. If your sign-in really needs longer, for example SSO with MFA through a wrapper, raise CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS.
- Requests through a company gateway fail: Claude Code uses the Bedrock Invoke API, not the Converse API, and the gateway has to pass the streaming response and its Content-Type header through unchanged.
Most of these come down to settings, so keep them in one place. The settings.json guide shows how to put the Bedrock env block in your user or project settings.
Short, practical drops on skills, MCP, agents, prompts, and more. No spam, unsubscribe anytime.
Frequently asked questions
How do I use Claude Code with Amazon Bedrock?
Enable an Anthropic model in the Amazon Bedrock console and submit the use case form, then run claude, choose 3rd-party platform and Amazon Bedrock, and follow the wizard. It sets your AWS credentials, region and model pins in ~/.claude/settings.json. For scripts or CI, set CLAUDE_CODE_USE_BEDROCK=1 and AWS_REGION instead.
Do I need a Claude subscription to use Claude Code on Bedrock?
No. On Bedrock you pay as you go through AWS and sign in with AWS credentials or an Amazon Bedrock API key. Features that need a claude.ai sign-in, like cloud sessions, Remote Control and /schedule, are not available.
Which model does Claude Code use on Bedrock by default?
Without a pin, the primary model defaults to an Opus model, billed at the higher Opus rate. Pin your models with ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL, or set ANTHROPIC_MODEL to a Sonnet ID to make Sonnet the default.
Does web search work in Claude Code on Bedrock?
No. The WebSearch tool is not available on Amazon Bedrock. Use the WebFetch tool with a specific URL for web lookups instead.
Can I use the Claude Code desktop app with Bedrock?
Not the standard app, which needs a claude.ai sign-in. Claude Desktop on 3P is a deployment mode that runs the Code tab on Amazon Bedrock. It is aimed at organizations that cannot send data through Anthropic's own products.
Last reviewed by David Iya on October 24, 2026

