2.0 KiB
2.0 KiB
summary, read_when
| summary | read_when | ||
|---|---|---|---|
| Use Amazon Bedrock (Converse API) models with Clawdbot |
|
Amazon Bedrock
Clawdbot 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.
What pi‑ai supports
- Provider:
amazon-bedrock - API:
bedrock-converse-stream - Auth: AWS credentials (env vars, shared config, or instance role)
- Region:
AWS_REGIONorAWS_DEFAULT_REGION(default:us-east-1)
Setup (manual)
- Ensure AWS credentials are available on the gateway host:
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"
- Add a Bedrock provider and model to your config:
{
models: {
providers: {
"amazon-bedrock": {
baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",
api: "bedrock-converse-stream",
models: [
{
id: "anthropic.claude-3-7-sonnet-20250219-v1:0",
name: "Claude 3.7 Sonnet (Bedrock)",
reasoning: true,
input: ["text"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 200000,
maxTokens: 8192
}
]
}
}
},
agents: {
defaults: {
model: { primary: "amazon-bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0" }
}
}
}
Notes
- Bedrock requires model access enabled in your AWS account/region.
- If you use profiles, set
AWS_PROFILEon the gateway host. - Reasoning support depends on the model; check the Bedrock model card for current capabilities.
- If you prefer a managed key flow, you can also place an OpenAI‑compatible proxy in front of Bedrock and configure it as an OpenAI provider instead.