Amazon Bedrock
Amazon Bedrock provides managed access to foundation models including Amazon's Nova family. AgentXchain connects via api_proxy through an OpenAI-compatible proxy that handles Bedrock's AWS SigV4 authentication.
Which adapter?
api_proxy with provider: "openai" and a base_url pointing to a local proxy that translates OpenAI-format requests into SigV4-signed Bedrock calls.
:::caution Bedrock does not accept API keys directly
Bedrock uses AWS IAM (SigV4 request signing), not Bearer token or API key authentication. The AgentXchain api_proxy adapter sends Authorization: Bearer <key> headers, which Bedrock rejects. You must run a local proxy that accepts OpenAI-compatible requests and translates them into signed Bedrock calls.
:::
Prerequisites
- An AWS account with Bedrock model access enabled for Nova models
- AWS credentials configured (
AWS_ACCESS_KEY_ID+AWS_SECRET_ACCESS_KEY, or an IAM role / SSO session) - A local OpenAI-compatible proxy for Bedrock (see below)
agentxchainCLI installed
Proxy setup
You need a proxy that accepts OpenAI-format POST /v1/chat/completions requests with Bearer auth and forwards them as SigV4-signed Bedrock Converse or InvokeModel calls. Two proven options:
Option A: LiteLLM proxy (recommended)
pip install litellm
litellm --model bedrock/amazon.nova-pro-v2 --port 4000
LiteLLM reads your AWS credentials from the environment (AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY or ~/.aws/credentials) and exposes http://localhost:4000/v1/chat/completions.
Option B: Bedrock Access Gateway
AWS provides Bedrock Access Gateway, a self-hosted Lambda + API Gateway that exposes an OpenAI-compatible API backed by Bedrock. Deploy it into your AWS account and use the resulting API Gateway URL as base_url.
Configuration
{
"runtimes": {
"nova-dev": {
"type": "api_proxy",
"provider": "openai",
"model": "bedrock/amazon.nova-pro-v2",
"auth_env": "LITELLM_API_KEY",
"base_url": "http://localhost:4000/v1/chat/completions"
}
},
"roles": {
"dev": {
"runtime": "nova-dev",
"mandate": "Implement features and fix bugs",
"authority": "proposed"
}
}
}
If your proxy does not require an API key, set auth_env to any non-empty environment variable — the adapter requires it but the proxy can ignore it.
Minimal working example
# 1. Start the proxy (in a separate terminal)
litellm --model bedrock/amazon.nova-pro-v2 --port 4000
# 2. Scaffold and run
agentxchain init --governed --template api-service --goal "Build a feedback intake API" --dir my-project -y
cd my-project
# Replace the scaffolded runtime wiring in agentxchain.json with the Bedrock config above.
export LITELLM_API_KEY="sk-placeholder"
agentxchain doctor
agentxchain connector check
agentxchain connector validate nova-dev
agentxchain run
If you prefer the guided interactive scaffold, run agentxchain init --governed without -y, then update agentxchain.json with the Bedrock config above before agentxchain connector check and agentxchain connector validate nova-dev.
Available models
| Model | Bedrock model ID | Best for |
|---|---|---|
| Nova 2 Pro | amazon.nova-pro-v2 | Most capable Nova model |
| Nova 2 Lite | amazon.nova-lite-v2 | Fast, cost-effective |
| Nova Premier | amazon.nova-premier | Premium reasoning |
The exact model ID string depends on your proxy. LiteLLM uses bedrock/<model-id>. Check your proxy's documentation.
Verify the connection
export LITELLM_API_KEY="sk-placeholder"
agentxchain connector check
agentxchain connector validate nova-dev
Gotchas
- No direct API key auth: Bedrock uses AWS SigV4 signing, not API keys or Bearer tokens. The proxy handles this translation. Do not point
base_urldirectly at abedrock-runtime.*.amazonaws.comURL — it will fail. - Proxy must be running: The proxy must be started before
connector check,connector validate, orrun. If you stop the proxy, AgentXchain will fail to reach the runtime. - Region: Ensure your AWS credentials and proxy target the same region where your Nova models are enabled.
- Model access: Nova models must be explicitly enabled in your AWS account via the Bedrock console before use.
- Cost rates: Bedrock pricing varies by region. Add an operator override keyed by the exact runtime
modelstring, since Bedrock models are not in the bundled defaults:
{
"budget": {
"cost_rates": {
"bedrock/amazon.nova-pro-v2": { "input_per_1m": 0.80, "output_per_1m": 3.20 }
}
}
}