AWS Bedrock Configuration
AWS Bedrock provides access to foundation models from Amazon and third-party providers like Anthropic Claude, Meta Llama, and Mistral.Prerequisites
- An AWS account with Bedrock access enabled
- IAM credentials with permissions to invoke Bedrock models
- The desired models enabled in your AWS Bedrock console
Environment Variables
When running Agent Canvas with the official Docker image, add these options to the documenteddocker run command:
ghcr.io/openhands/agent-canvas:latest image includes the AWS SDK for Python (boto3).
Make sure you have enabled the Bedrock models you want to use in the AWS Console. Go to Amazon Bedrock → Model access and request access to the models you need.
UI Configuration
In Agent Canvas:- Open
Settings > LLMand enable theAdvancedoptions. - Set
Custom Modelto the Bedrock model or inference profile ID. See Model IDs. - Leave
Base URLempty because Bedrock uses AWS endpoints automatically. - Leave
API Keyempty because authentication is handled through your AWS credentials. - Save the profile and start a new conversation to test it.
Model IDs
Bedrock model IDs are managed by AWS and may change over time. Use the exact Model ID from the AWS Console or the AWS documentation (nobedrock/ prefix).
Example format:
Custom Model:anthropic.claude-3-5-sonnet-20241022-v2:0
Cross-Region Inference
Some models must be invoked through a cross-region inference profile rather than their direct foundation model ID. Inference profile IDs include a geographic prefix such asus..
For example, use:
Custom Model:us.anthropic.claude-sonnet-4-5-20250929-v1:0
anthropic.claude-sonnet-4-5-20250929-v1:0
Using IAM Roles (Alternative to Access Keys)
If running OpenHands on AWS infrastructure such as EC2, ECS, or Lambda, you can use IAM roles instead of access keys:- Attach an IAM role with Bedrock permissions to your compute resource.
- Omit the
LLM_AWS_ACCESS_KEY_IDandLLM_AWS_SECRET_ACCESS_KEYenvironment variables. - The AWS SDK automatically uses the instance role credentials.
Troubleshooting
”No module named ‘boto3’” Error
If you encounter this error:-
Docker: The current
ghcr.io/openhands/agent-canvas:latestimage includesboto3. Pull the latest image and recreate the container: - npm or npx: The Python environment managed by the npm distribution may not include the optional Bedrock dependency. Follow OpenHands issue #16578 for the package fix. Use the official Agent Canvas Docker image if you need Bedrock while that issue remains open.
boto3 into a temporary uv archive environment because Agent Canvas may recreate that environment.
On-Demand Throughput Is Not Supported
Some foundation model IDs cannot be invoked directly and return an error similar to:us.anthropic.claude-sonnet-4-5-20250929-v1:0. This error does not indicate a credential, model access, or boto3 problem.
Access Denied Errors
If you receive access denied errors:- Verify your IAM credentials have the
bedrock:InvokeModelpermission - Check that the model is enabled in your AWS Bedrock console
- Ensure you’re using the correct AWS region where the model is available
Model Not Found
If the model is not found:- Verify the model ID is correct (check AWS documentation)
- Ensure the model is enabled in your Bedrock model access settings
- Check that the model is available in your selected AWS region

