Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
OpenClaw can use Amazon Bedrock models via pi-ai's Bedrock Converse streaming provider. Bedrock auth uses the AWS SDK default credential chain, not an API key.
| Property | Value |
|---|---|
| Provider | text amazon-bedrock |
| API | text bedrock-converse-stream |
| Auth | AWS credentials (env vars, shared config, or instance role) |
| Region | text AWS_REGIONtext AWS_DEFAULT_REGIONtext us-east-1 |
Choose your preferred auth method and follow the setup steps.
text<Steps> <Step title="Set AWS credentials on the gateway host"> ```bash} export AWS_ACCESS_KEY_ID="AKIA..." export AWS_SECRET_ACCESS_KEY="..." export AWS_REGION="us-east-1" # Optional: export AWS_SESSION_TOKEN="..." export AWS_PROFILE="your-profile" # Optional (Bedrock API key/bearer token): export AWS_BEARER_TOKEN_BEDROCK="..." ``` </Step> <Step title="Add a Bedrock provider and model to your config"> No `apiKey` is required. Configure the provider with `auth: "aws-sdk"`: ```json5} { models: { providers: { "amazon-bedrock": { baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com", api: "bedrock-converse-stream", auth: "aws-sdk", models: [ { id: "us.anthropic.claude-opus-4-6-v1:0", name: "Claude Opus 4.6 (Bedrock)", reasoning: true, input: ["text", "image"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 200000, maxTokens: 8192, }, ], }, }, }, agents: { defaults: { model: { primary: "amazon-bedrock/us.anthropic.claude-opus-4-6-v1:0" }, }, }, } ``` </Step> <Step title="Verify models are available"> ```bash} openclaw models list ``` </Step> </Steps> <Tip> With env-marker auth (`AWS_ACCESS_KEY_ID`, `AWS_PROFILE`, or `AWS_BEARER_TOKEN_BEDROCK`), OpenClaw auto-enables the implicit Bedrock provider for model discovery without extra config. </Tip>
text<Steps> <Step title="Enable discovery explicitly"> When using IMDS, OpenClaw cannot detect AWS auth from env markers alone, so you must opt in: ```bash} openclaw config set plugins.entries.amazon-bedrock.config.discovery.enabled true openclaw config set plugins.entries.amazon-bedrock.config.discovery.region us-east-1 ``` </Step> <Step title="Optionally add an env marker for auto mode"> If you also want the env-marker auto-detection path to work (for example, for `openclaw status` surfaces): ```bash} export AWS_PROFILE=default export AWS_REGION=us-east-1 ``` You do **not** need a fake API key. </Step> <Step title="Verify models are discovered"> ```bash} openclaw models list ``` </Step> </Steps> <Warning> The IAM role attached to your EC2 instance must have the following permissions: * `bedrock:InvokeModel` * `bedrock:InvokeModelWithResponseStream` * `bedrock:ListFoundationModels` (for automatic discovery) * `bedrock:ListInferenceProfiles` (for inference profile discovery) Or attach the managed policy `AmazonBedrockFullAccess`. </Warning> <Note> You only need `AWS_PROFILE=default` if you specifically want an env marker for auto mode or status surfaces. The actual Bedrock runtime auth path uses the AWS SDK default chain, so IMDS instance-role auth works even without env markers. </Note>
OpenClaw can automatically discover Bedrock models that support streaming and text output. Discovery uses
bedrock:ListFoundationModelsbedrock:ListInferenceProfilesHow the implicit provider is enabled:
plugins.entries.amazon-bedrock.config.discovery.enabledtrueplugins.entries.amazon-bedrock.config.discovery.enabledAWS_BEARER_TOKEN_BEDROCKAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_PROFILEenabled: trueThis walkthrough creates an IAM role, attaches Bedrock permissions, associates the instance profile, and enables OpenClaw discovery on the EC2 host.
bash# 1. Create IAM role and instance profile aws iam create-role --role-name EC2-Bedrock-Access \ --assume-role-policy-document '{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": {"Service": "ec2.amazonaws.com"}, "Action": "sts:AssumeRole" }] }' aws iam attach-role-policy --role-name EC2-Bedrock-Access \ --policy-arn arn:aws:iam::aws:policy/AmazonBedrockFullAccess aws iam create-instance-profile --instance-profile-name EC2-Bedrock-Access aws iam add-role-to-instance-profile \ --instance-profile-name EC2-Bedrock-Access \ --role-name EC2-Bedrock-Access # 2. Attach to your EC2 instance aws ec2 associate-iam-instance-profile \ --instance-id i-xxxxx \ --iam-instance-profile Name=EC2-Bedrock-Access # 3. On the EC2 instance, enable discovery explicitly openclaw config set plugins.entries.amazon-bedrock.config.discovery.enabled true openclaw config set plugins.entries.amazon-bedrock.config.discovery.region us-east-1 # 4. Optional: add an env marker if you want auto mode without explicit enable echo 'export AWS_PROFILE=default' >> ~/.bashrc echo 'export AWS_REGION=us-east-1' >> ~/.bashrc source ~/.bashrc # 5. Verify models are discovered openclaw models list
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine