Vault / wiki/201/claude-bedrock.md
updated 2026-05-28Claude in Amazon Bedrock
Claude is available through AWS Bedrock as a managed inference service. Same Messages API shape, AWS auth model, regional endpoints.
Why use Bedrock
- Data stays in AWS (compliance, residency).
- IAM-based auth — no Anthropic API key.
- Bedrock Knowledge Bases, Guardrails, Agents on top of Claude.
- VPC PrivateLink for private connectivity.
SDK shape
Same Anthropic SDK with the AnthropicBedrock client:
from anthropic import AnthropicBedrock
client = AnthropicBedrock(
aws_region="us-east-1",
# auth via standard AWS credential chain
)
resp = client.messages.create(
model="anthropic.claude-sonnet-4-6-v1:0", # Bedrock model ID
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
Differences vs first-party Anthropic API
| Aspect | Anthropic API | Bedrock |
|---|---|---|
| Auth | API key | AWS IAM/SigV4 |
| Model ID | claude-sonnet-4-6 | anthropic.claude-sonnet-4-6-v1:0 |
| Region | Single endpoint | Per-AWS-region |
| Tool use | Native | Native (same shape) |
| Prompt caching | Yes | Yes (recently added) |
| Batch API | Yes | Bedrock Batch (different surface) |
| Latest models | First | Slight lag — new models land on first-party first |
When to choose Bedrock
- You already live in AWS and need IAM.
- Regulatory pressure for in-region data processing.
- You want Bedrock Guardrails or Knowledge Bases.
When to choose first-party
- Latest models, fastest.
- Simpler billing / less infra.
- Building products that aren't AWS-native.