Documentation Index
Fetch the complete documentation index at: https://allhandsai-openhands-add-aws-bedrock-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
A ready-to-run example is available here!Use AWS Bedrock to access Claude and other foundation models through your AWS account.
Prerequisites
AWS Bedrock requires theboto3 library:
boto3 is used internally by LiteLLM - you don’t need to import it in your code.Authentication Options
Configure AWS credentials using environment variables:| Method | Environment Variables |
|---|---|
| Access Keys | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY |
| Session Token | AWS_SESSION_TOKEN (in addition to access keys) |
| AWS Profile | AWS_PROFILE_NAME |
| IAM Role | AWS_ROLE_NAME, AWS_WEB_IDENTITY_TOKEN |
| Bedrock API Key | AWS_BEARER_TOKEN_BEDROCK |
Model Names
Use thebedrock/ prefix followed by the Bedrock model ID:
| Model | Model ID |
|---|---|
| Claude 3.5 Sonnet v2 | bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0 |
| Claude 3 Opus | bedrock/anthropic.claude-3-opus-20240229-v1:0 |
| Claude 3 Haiku | bedrock/anthropic.claude-3-haiku-20240307-v1:0 |
| Claude 3.5 Haiku | bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 |
Basic Usage
Ready-to-run Example
Before running, ensure you have:
- Installed
boto3>=1.28.57 - Set AWS credentials via environment variables
- Enabled the model in your AWS Bedrock console
Running the Example
Cross-Region Inference
AWS Bedrock supports cross-region inference. Include the region prefix in your model ID:Troubleshooting
Access Denied
Ensure your AWS credentials have thebedrock:InvokeModel permission.
Model Not Found
Verify the model is enabled in your AWS account:- Go to AWS Console > Bedrock > Model access
- Enable the models you want to use
Region Issues
EnsureAWS_REGION_NAME is set to a region where:
- Bedrock is available
- You have model access enabled
Next Steps
- LLM Registry - Manage multiple LLM providers
- LLM Routing - Automatically route to different models
- OpenHands Bedrock Guide - Self-hosted OpenHands configuration

