Why Use Claude Through Amazon Bedrock
Amazon Bedrock is AWS's fully managed generative AI service that provides access to leading foundation models, including Anthropic's Claude, through a unified API.
Compared to using the Anthropic API directly, running Claude through Bedrock offers distinct advantages for teams already invested in the AWS ecosystem. You get seamless integration with existing infrastructure, fine-grained access control through IAM, private communication via VPC endpoints, and built-in monitoring through CloudWatch — all without managing separate API keys.
As of March 2026, Bedrock supports the latest Claude models including Opus 4.6, Sonnet 4.6, Sonnet 4.5, and Haiku 4.5, with context windows up to 1 million tokens for handling large-scale document processing tasks.
Prerequisites
Before getting started, make sure you have the following ready:
- AWS Account: Sign up at the AWS Management Console
- AWS CLI v2.13.23 or later: Required for programmatic access
- Python 3.8+ or Node.js 18+: Runtime for the SDK
- Appropriate IAM permissions: Access to
bedrock:InvokeModelandbedrock:ListFoundationModels
Step-by-Step Setup
Configure the AWS CLI
Start by installing the AWS CLI and setting up your credentials.
# Install AWS CLI (macOS)
brew install awscli
# Configure credentials
aws configure
# AWS Access Key ID: [enter your access key]
# AWS Secret Access Key: [enter your secret key]
# Default region name: us-west-2
# Default output format: json
# Verify your configuration
aws sts get-caller-identity
# Expected output:
# {
# "UserId": "AIDAXXXXXXXXXXXXXXXXX",
# "Account": "123456789012",
# "Arn": "arn:aws:iam::123456789012:user/your-username"
# }Enable Model Access in Bedrock
You need to request access to Anthropic's models through the AWS Console.
- Log in to the AWS Console
- Navigate to Bedrock > Model access
- Click Manage model access
- Check the boxes for Anthropic models (e.g., Claude Opus 4.6)
- Click Request model access
Access is typically granted within a few minutes.
Install the SDK
Anthropic's official SDKs natively support Bedrock.
# For Python
pip install -U "anthropic[bedrock]"
# For TypeScript
npm install @anthropic-ai/bedrock-sdkMaking API Calls
Basic Python Example
from anthropic import AnthropicBedrock
# Initialize the client
# Uses the default AWS credential provider (~/.aws/credentials)
client = AnthropicBedrock(
aws_region="us-west-2",
)
# Send a message
message = client.messages.create(
model="global.anthropic.claude-opus-4-6-v1",
max_tokens=1024,
messages=[
{"role": "user", "content": "Write a Python function that generates the Fibonacci sequence"}
],
)
print(message.content[0].text)
# Expected output:
# def fibonacci(n):
# """Return the first n Fibonacci numbers"""
# if n <= 0:
# return []
# ...Basic TypeScript Example
import AnthropicBedrock from "@anthropic-ai/bedrock-sdk";
const client = new AnthropicBedrock({
awsRegion: "us-west-2",
});
async function main() {
const message = await client.messages.create({
model: "global.anthropic.claude-opus-4-6-v1",
max_tokens: 1024,
messages: [
{ role: "user", content: "Design a type-safe API client in TypeScript" },
],
});
console.log(message.content[0].text);
}
main().catch(console.error);Streaming Responses
For real-time output, use the streaming API.
from anthropic import AnthropicBedrock
client = AnthropicBedrock(aws_region="us-west-2")
# Stream responses in real time
with client.messages.stream(
model="global.anthropic.claude-sonnet-4-6",
max_tokens=1024,
messages=[
{"role": "user", "content": "Explain AWS best practices for security"}
],
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
# Output: Text appears in real time as it's generatedAvailable Claude Models on Bedrock
Here are the key Claude models available through Bedrock as of March 2026:
| Model | Model ID | Global | US | EU | JP |
|-------|----------|:------:|:--:|:--:|:--:|
| Claude Opus 4.6 | anthropic.claude-opus-4-6-v1 | Yes | Yes | Yes | Yes |
| Claude Sonnet 4.6 | anthropic.claude-sonnet-4-6 | Yes | Yes | Yes | Yes |
| Claude Sonnet 4.5 | anthropic.claude-sonnet-4-5-20250929-v1:0 | Yes | Yes | Yes | Yes |
| Claude Haiku 4.5 | anthropic.claude-haiku-4-5-20251001-v1:0 | Yes | Yes | Yes | — |
You can list available models with the following command:
aws bedrock list-foundation-models \
--region=us-west-2 \
--by-provider anthropic \
--query "modelSummaries[*].modelId"
# Expected output:
# [
# "anthropic.claude-opus-4-6-v1",
# "anthropic.claude-sonnet-4-6",
# ...
# ]Global vs Regional Endpoints
Bedrock offers two endpoint types, applicable to Claude Sonnet 4.5 and newer models.
Global Endpoints (Recommended)
Requests are automatically routed to the optimal region for maximum availability. There's no additional cost.
# Global endpoint (default)
message = client.messages.create(
model="global.anthropic.claude-opus-4-6-v1", # global. prefix
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)Regional Endpoints (CRIS)
When data residency requirements dictate where your data must be processed, you can specify a region. This comes with a 10% pricing premium.
# Regional endpoint (US)
message = client.messages.create(
model="us.anthropic.claude-opus-4-6-v1", # us. prefix
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)
# Regional endpoint (Japan)
message = client.messages.create(
model="jp.anthropic.claude-opus-4-6-v1", # jp. prefix
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)Unless you have specific data residency requirements, global endpoints are recommended for the best availability and cost efficiency.
Key Differences from the Direct API
There are a few important distinctions when using Claude through Bedrock versus the direct Anthropic API.
Authentication: Instead of an Anthropic API key, Bedrock uses AWS credentials (IAM). This lets you leverage your existing AWS security infrastructure without managing separate API keys.
SDK packages: For Python, you use anthropic[bedrock]; for TypeScript, @anthropic-ai/bedrock-sdk. However, the Messages API interface is nearly identical, making migration straightforward.
Request size limits: Bedrock caps request payloads at 20 MB. When sending large documents or many images, you may hit this limit before reaching the token limit.
Pricing: Bedrock charges are consolidated into your AWS bill. Global endpoints offer pricing comparable to the direct API, while regional endpoints carry a 10% premium.
Practical Example: Document Analysis Pipeline
Here's a real-world example combining Bedrock and Claude for structured document analysis.
import boto3
import json
from anthropic import AnthropicBedrock
client = AnthropicBedrock(aws_region="us-west-2")
def analyze_document(document_text: str) -> dict:
"""Analyze a document and return a structured summary"""
message = client.messages.create(
model="global.anthropic.claude-sonnet-4-6",
max_tokens=2048,
messages=[
{
"role": "user",
"content": f"""Analyze the following document and return a JSON summary.
Output format:
{{
"title": "Document title",
"summary": "Summary in 200 characters or less",
"key_points": ["point 1", "point 2", "point 3"],
"sentiment": "positive/negative/neutral",
"category": "Document category"
}}
Document:
{document_text}"""
}
],
)
return json.loads(message.content[0].text)
# Usage
result = analyze_document("The latest announcements from AWS re:Invent 2025...")
print(json.dumps(result, indent=2))
# Expected output:
# {
# "title": "AWS re:Invent 2025 New Service Announcements",
# "summary": "...",
# "key_points": ["...", "...", "..."],
# "sentiment": "positive",
# "category": "Technology"
# }Wrapping Up
Amazon Bedrock makes it straightforward to integrate Claude into your existing AWS infrastructure. Setup requires just AWS CLI configuration and model access approval, and Anthropic's official SDKs work seamlessly with Bedrock, keeping the implementation barrier low.
With global endpoints for high availability and regional endpoints for data compliance, Bedrock is well-suited for enterprise deployments. If you're building AI-powered applications on AWS, the Bedrock and Claude combination is well worth considering.
For foundational Claude API usage, check out "[Getting Started with Claude API and Python]((/articles/api-sdk/claude-api-python-sdk-chatbot-tutorial)." To optimize your API costs, see "[Complete Guide to Claude API Token-Saving Updates]((/articles/api-sdk/claude-api-token-saving-updates-cost-optimization)."