AWS Builder Center

Integrate Claude with AWS Bedrock

Hit your Claude Code usage limit but not ready to jump to a higher subscription tier? This guide shows you how to route both Claude Code and Claude Cowork through AWS Bedrock, giving you access to the full Claude lineup — Haiku, Sonnet, Opus, and the latest Fable 5 — via global inference profiles.

Claude Code offers two subscription tiers: Pro and Max. The Max tier costs at least 5 times more than Pro but provides significantly higher usage quotas. If you've exhausted your Pro tier usage but aren't ready to upgrade to Max, you can temporarily use Claude Sonnet models from AWS Bedrock instead.
This guide shows you how to connect Claude Code to Claude models in Bedrock.

Prerequisites

Install Claude Code and Claude Cowork.

Step 1: Verify Your AWS CLI Configuration

Confirm you have an active AWS CLI profile by running following command. It should return your AWS user ID and account number.
1
aws sts get-caller-identity
If you have multiple AWS profiles configured, check which profile is currently active:
1
echo $AWS_PROFILE

Step 2: Identify Available Inference Profiles

List the available inference profile IDs:
1
aws bedrock list-inference-profiles | grep inferenceProfileArn | grep global.anthropic
This will return profiles similar to:
1
2
3
4
5
6
7
8
9
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-haiku-4-5-20251001-v1:0",
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-opus-4-6-v1",
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-sonnet-4-6",
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-sonnet-4-20250514-v1:0",
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-sonnet-4-5-20250929-v1:0",
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-opus-4-5-20251101-v1:0",
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-opus-4-7",
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-opus-4-8",
"inferenceProfileArn": "arn:aws:bedrock:us-west-2:460453255610:inference-profile/global.anthropic.claude-fable-5",
Take note of the inference profile name after "inference-profile/" for each of the model class.
1
2
3
4
"global.anthropic.claude-haiku-4-5-20251001-v1:0"
"global.anthropic.claude-sonnet-4-6"
"global.anthropic.claude-opus-4-8"
"global.anthropic.claude-fable-5"

Setup Claude Code

Step 3: Configure Environment Variables

You will update Claude settings to point Claude to Amazon Bedrock.
Edit the Claude settings using vim or any editor.
1
vim ~/.claude/settings.json
Update the file with following environment variables:
  • Set the environment variable CLAUDE_CODE_USE_BEDROCK to 1 so that Claude Code will use models from Amazon Bedrock.
  • Set the AWS_REGION to us-east-1 because the latest Claude Fable 5 is currently available in this region only.
  • Set the default model of each model class to the respective global inference profile found in step 2.
  • Mantle is the new Bedrock Endpoint to serve LLM models. Set CLAUDE_CODE_USE_MANTLE to 1 to use it.
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1",
"AWS_REGION": "us-east-1",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "global.anthropic.claude-haiku-4-5-20251001-v1:0",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "global.anthropic.claude-sonnet-4-6",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "global.anthropic.claude-opus-4-8",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "global.anthropic.claude-fable-5",
"CLAUDE_CODE_USE_MANTLE": "1",
"CLAUDE_CODE_EFFORT_LEVEL": "xhigh",
"API_TIMEOUT_MS": "1800000"
}
}

Step 4 (Optional): Enable Data Retention

This step is optional - only if you would like to use Anthropic newer model like Fable 5. Anthropic now require 30-day retention for all traffic on Mythos-class models, which includes Fable 5.
[Option 1]
Run following Bash command in terminal. You should already have environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN automatically set when you authenticate with AWS CLI at Step 1.
1
2
3
4
5
6
curl -X PUT https://bedrock-mantle.us-east-1.api.aws/v1/data_retention \
--aws-sigv4 "aws:amz:us-east-1:bedrock" \
--user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
-H "x-amz-security-token: $AWS_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode": "provider_data_share", "modelId": "anthropic.claude-fable-5"}'
[Option 2]
Alternatively, you can run following Python script. Save following code in a file claude_enable_data_retention.py and run it in terminal.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import boto3, json
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
import requests as req

session = boto3.Session(region_name='us-east-1')
credentials = session.get_credentials().get_frozen_credentials()

url = 'https://bedrock-mantle.us-east-1.api.aws/v1/data_retention'
body = json.dumps({
'mode': 'provider_data_share',
'modelId': 'anthropic.claude-fable-5'
})

request = AWSRequest(method='PUT', url=url, data=body,
headers={'Content-Type': 'application/json'})
SigV4Auth(credentials, 'bedrock', 'us-east-1').add_auth(request)

r = req.put(url, headers=dict(request.headers), data=body)
print(r.status_code, r.json())
1
pip install boto3 botocore requests && python claude_enable_data_retention.py

Step 5: Test Claude Code

Run Claude Code in the terminal. Run /model to select a model, e.g. the latest Fable 5 model.
1
claude
Claude Code model selection showing available Bedrock models
You can test by asking it question: Which model are you? When is the cut-off date of your data?
Claude Code response showing model identity from Bedrock
Use /status to confirm that Claude Code is using model from Amazon Bedrock.
Claude Code status output confirming Bedrock model

Step 6: Setup Claude Cowork

Download and install Claude Cowork.
You must enable Developer Mode in Cowork to unlock its advanced configuration menus in the Claude Desktop app:
  1. Open the Claude Desktop application.
  2. Navigate to the menu bar: Help → Troubleshooting → Enable Developer mode.
  3. The app may require a restart to show the new Developer menu.
Once Developer mode is active, Go to menu Developer → Configure third-party inference in the menu bar. In the Connection tab, select Bedrock as the inference provider.
Fill in the following details in Bedrock credentials and leave others with default values.
  • Credential kind: Cloud vendor profile
  • Region: us-east-1
  • AWS profile name: <AWS_PROFILE_NAME_IN_STEP_1>
Claude Cowork Bedrock credential configuration
In Models, Add following model profiles, which you found in Step 2, one by one to the list.
1
2
3
4
global.anthropic.claude-haiku-4-5-20251001-v1:0
global.anthropic.claude-sonnet-4-6
global.anthropic.claude-opus-4-8
global.anthropic.claude-fable-5
Claude Cowork model profiles configuration
After you click on Apply locally, the app will restart and offer a "3P Mode" on the launch screen, allowing you to bypass standard Anthropic login.

Summary

This guide walks through configuring both Claude Code and Claude Cowork to use Claude models on AWS Bedrock instead of the Claude API — useful when your subscription usage is exhausted or you want direct access to specific models. It covers verifying your AWS CLI setup, listing global inference profiles, pointing Claude Code at Bedrock through environment variables (including the new Mantle endpoint), enabling the 30-day data retention required for Fable 5, testing the connection, and configuring Bedrock as a third-party inference provider in Claude Cowork.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article