How to Integrate Amazon Bedrock Models in Openclaw
Amazon Bedrock gives you access to foundation models from Anthropic, Amazon, and other providers through a unified API. This guide shows you how to connect Openclaw to Bedrock for seamless model integration.
Prerequisites
Before starting, ensure you have:
- An AWS account with Bedrock access enabled
- AWS credentials (Access Key ID and Secret Access Key)
- Openclaw installed and configured
Step 1: Export AWS Credentials
Set your AWS credentials as environment variables on your gateway host:
export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="us-east-1"
Step 2: Configure Openclaw
Add the Bedrock configuration to your openclaw.json file:
{
"models": {
"bedrockDiscovery": {
"enabled": true,
"region": "us-east-1",
"providerFilter": ["anthropic", "amazon"],
"refreshInterval": 3600
}
}
}
The providerFilter option lets you control which model providers appear in your available models list. The refreshInterval controls how often Openclaw fetches the latest model catalog (in seconds).
Step 3: Verify the Integration
Test your setup by listing available Bedrock models:
openclaw models list --provider bedrock
You should see models like Claude 3.5 Sonnet, Claude 3 Opus, and Amazon Titan models if your AWS account has access to them.
Using Bedrock Models
Once configured, set a Bedrock model as your default:
openclaw models set bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0
For more deployment options, check out our guide on Deploy Hetzner Openclaw.
Available Models
Bedrock provides access to several high-quality models:
- Anthropic Claude 3.5 Sonnet — Excellent for coding and reasoning tasks
- Anthropic Claude 3 Opus — Best for complex analysis and writing
- Amazon Titan — Good for general-purpose tasks
- Meta Llama — Open-weight models for cost-effective inference
Troubleshooting
Model not appearing: Verify your AWS account has Bedrock access and the specific model is enabled in your region.
Authentication errors: Double-check your AWS credentials are exported correctly and have the necessary permissions for bedrock:InvokeModel.
Rate limiting: Bedrock has quota limits per account. Monitor your usage in the AWS Console.
If you are new to Openclaw, you might also want to read about Elevated Mode for advanced permissions.
Best Practices
- Use IAM roles instead of long-term access keys when running on AWS infrastructure
- Enable model discovery to automatically get new models as they become available
- Set appropriate refreshInterval values to balance freshness with API calls
