Claude Academy
Sign in

Building with the Claude API · lesson 17 of 17

Claude 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

AspectAnthropic APIBedrock
AuthAPI keyAWS IAM/SigV4
Model IDclaude-sonnet-4-6anthropic.claude-sonnet-4-6-v1:0
RegionSingle endpointPer-AWS-region
Tool useNativeNative (same shape)
Prompt cachingYesYes (recently added)
Batch APIYesBedrock Batch (different surface)
Latest modelsFirstSlight 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.

See also