What Is Amazon Bedrock
Amazon Bedrock is a fully managed AI service platform by AWS that provides foundation models from multiple vendors including Anthropic, Meta, and Mistral. Through Bedrock, you can securely call various large language models within AWS infrastructure while leveraging AWS's security compliance framework, VPC network isolation, and IAM access management.
OpenClaw treats Amazon Bedrock as a first-class provider, allowing you to access all available Bedrock models using the standard provider/model-name format. For teams already heavily invested in AWS services, Bedrock is a natural and efficient choice.
Prerequisites
Before you begin configuration, complete the following preparations:
- AWS Account: Ensure you have an active AWS account.
- Enable Bedrock Service: Navigate to Amazon Bedrock in the AWS Console and apply for access to the models you need. Some models (such as the Claude series) require separate access approval.
- Create IAM Credentials: Create an IAM user or role with
bedrock:InvokeModelpermissions, and obtain the Access Key ID and Secret Access Key.
It is recommended to use IAM policies to precisely control which models are accessible, following the principle of least privilege.
Using OpenClaw Onboard for Configuration
The simplest way to configure is using OpenClaw's built-in guided setup:
openclaw onboard
Select Amazon Bedrock as the provider and follow the prompts to enter your AWS credentials and region settings. The guided tool will automatically generate the configuration file.
Manual Configuration of openclaw.json
Manually edit openclaw.json to configure Bedrock:
{
"agents": {
"defaults": {
"model": {
"primary": "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0"
}
}
}
}
Bedrock model names follow AWS's own model ID format and require the bedrock/ prefix in OpenClaw.
Configuring AWS Authentication
Bedrock authentication differs slightly from other providers, requiring AWS credential information:
{
"providers": {
"bedrock": {
"region": "us-east-1",
"auth": [
{
"accessKeyId": "YOUR_AWS_ACCESS_KEY_ID",
"secretAccessKey": "YOUR_AWS_SECRET_ACCESS_KEY"
}
]
}
}
}
You can also configure multiple sets of AWS credentials for multi-account rotation:
{
"providers": {
"bedrock": {
"region": "us-east-1",
"auth": [
{
"accessKeyId": "ACCOUNT_A_KEY",
"secretAccessKey": "ACCOUNT_A_SECRET",
"profile": "Primary account"
},
{
"accessKeyId": "ACCOUNT_B_KEY",
"secretAccessKey": "ACCOUNT_B_SECRET",
"profile": "Backup account"
}
]
}
}
}
When the primary account is rate-limited or encounters authentication failures, OpenClaw automatically switches to the backup account and initiates cooldown tracking for the primary account, retrying it after a period of time.
Popular Models on Bedrock
Here are some commonly used models accessible through Bedrock:
- bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0: Claude 3.5 Sonnet, an exceptionally cost-effective all-purpose model.
- bedrock/anthropic.claude-3-opus-20240229-v1:0: Claude 3 Opus, the top choice for complex reasoning tasks.
- bedrock/meta.llama3-1-70b-instruct-v1:0: Meta Llama 3.1 70B, a powerful open-source model.
- bedrock/mistral.mistral-large-2407-v1:0: Mistral Large, the flagship model from the European AI company.
Note that model availability on Bedrock depends on the AWS region you select — different regions may support different model catalogs.
Region Selection Tips
AWS Bedrock is available in multiple regions. When choosing a region, consider:
- Latency: Choose a region closest to your users.
- Model availability: us-east-1 and us-west-2 typically support the most models.
- Compliance requirements: Certain data regulations may require data to stay within specific geographic boundaries, requiring a corresponding region.
Configuring Failover
It is recommended to configure cross-provider failover for Bedrock:
{
"agents": {
"defaults": {
"model": {
"primary": "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
"fallback": "anthropic/claude-3-5-sonnet-20241022"
}
}
}
}
This way, if the Bedrock service encounters issues, the system automatically switches to the Anthropic direct API, ensuring uninterrupted service.
Unique Advantages of Bedrock
Advantages of accessing models through Bedrock compared to using vendor APIs directly:
- Unified billing: All model costs are consolidated in your AWS bill, simplifying financial management.
- Enterprise security: Inherits AWS's security compliance framework, supporting VPC, private links, and other enterprise-grade network configurations.
- No need to manage multiple API keys: A single set of AWS credentials provides access to all models on Bedrock.
After completing the configuration above, send a test message to verify that the Bedrock connection is working properly. Check the OpenClaw logs to confirm that requests are being correctly routed to the Bedrock service.