CLAUDE LABJP
WWDC — WWDC 2026 opens Jun 8; the revamped Siri is reported to run on Google Gemini, with Claude among the third-party AI choicesBILLING — From Jun 15, Agent SDK, headless Claude Code, GitHub Actions, and third-party agents move off subscription limits to API-rate monthly credit (1 week left)FALLBACK — Claude Code adds a fallbackModel setting that tries up to three models in order when the primary is overloaded (Jun)DENY-GLOB — Deny rules now support glob patterns in the tool-name position, with stronger cross-session message security (Jun)OPUS4.8 — Claude Opus 4.8 is now the default on Max, Team Premium, Enterprise pay-as-you-go, and the Anthropic API (Jun)MANAGED-AGENTS — Claude Managed Agents can run in a sandbox you control and connect to your private MCP servers (Jun)WWDC — WWDC 2026 opens Jun 8; the revamped Siri is reported to run on Google Gemini, with Claude among the third-party AI choicesBILLING — From Jun 15, Agent SDK, headless Claude Code, GitHub Actions, and third-party agents move off subscription limits to API-rate monthly credit (1 week left)FALLBACK — Claude Code adds a fallbackModel setting that tries up to three models in order when the primary is overloaded (Jun)DENY-GLOB — Deny rules now support glob patterns in the tool-name position, with stronger cross-session message security (Jun)OPUS4.8 — Claude Opus 4.8 is now the default on Max, Team Premium, Enterprise pay-as-you-go, and the Anthropic API (Jun)MANAGED-AGENTS — Claude Managed Agents can run in a sandbox you control and connect to your private MCP servers (Jun)
Articles/API & SDK
API & SDK/2026-03-25Intermediate

Claude on Amazon Bedrock: Complete Setup Guide with API Implementation Examples

Learn how to use Claude AI through Amazon Bedrock. This guide covers AWS CLI setup, Python and TypeScript API calls, global vs regional endpoints, and practical code examples for enterprise deployments.

Amazon BedrockAWS2Claude API108Python27TypeScript34Enterprise10

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:InvokeModel and bedrock: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.

  1. Log in to the AWS Console
  2. Navigate to Bedrock > Model access
  3. Click Manage model access
  4. Check the boxes for Anthropic models (e.g., Claude Opus 4.6)
  5. 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-sdk

Making 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 generated

Available 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)."

Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

API & SDK2026-04-05
Claude API on Google Cloud Vertex AI — Complete Integration Guide for GCP
Learn how to use Claude Sonnet 4.6 via Google Cloud Vertex AI. Covers project setup, IAM configuration, Python and TypeScript implementations, Cloud Run deployment, and cost management with practical code examples.
API & SDK2026-05-05
Building an Internal Document Search Agent with Claude API — Hybrid RAG, Role-Based Access Control, and Audit Logging in Production
Build a production-grade internal document search agent using Claude API and Python. Covers hybrid RAG (pgvector + BM25), department-level RBAC via PostgreSQL RLS, and compliance-ready audit logging — with working code for each component.
API & SDK2026-04-13
Building Enterprise AI Backends with Claude API and NestJS: Production
A complete production guide to integrating Claude API into NestJS using dependency injection, TypeORM, SSE streaming, JWT auth, and Bull queues—with working code you can deploy today.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →