Subchapter 27.75
references/vendored/ai/ai-anthropic-to-bedrock.mdMarkdown4 KBView on GitHub
Canonical Anthropic-SDK → Bedrock client-swap guide. Source-cloud agnostic: the mapping depends on the SDK the code uses, never on which cloud hosted it. Vendored into each consuming skill as and kept byte-identical by ; edit HERE, then run .
references/vendored/ai/ai-anthropic-to-bedrock.mdshared:checkshared:syncLoaded by design-ai.md when ai_source == "anthropic".
The user is already on Claude via the Anthropic SDK. Migration is a client swap only.
No model change, no prompt rewriting, no retraining required.
| Anthropic SDK model | Bedrock model ID | Tier | Input/Output per 1M |
|---|---|---|---|
claude-opus-4-* | anthropic.claude-opus-4-8 | Premium | $5 / $25 |
claude-sonnet-5-* | anthropic.claude-sonnet-5 | Flagship | $2 / $10 intro† |
claude-sonnet-4-* | anthropic.claude-sonnet-5 | Flagship | $2 / $10 intro† |
claude-haiku-4-* | anthropic.claude-haiku-4-5-20251001-v1:0 | Fast | $1 / $5 |
† Claude Sonnet 5 intro pricing through Aug 31, 2026; then $3 / $15 (same as Sonnet 4.6). Prefer the us. inference-profile prefix for on-demand invoke. Sonnet 4.6 (anthropic.claude-sonnet-4-6) remains Active if the customer must stay on the 4.6 SKU.
Older Claude models — Claude 3.5 Haiku, Claude 3 Sonnet, Claude 3.5 Sonnet (v1/v2), Claude 3 Haiku, and Claude 3.7 Sonnet — are past EOL or within the 90-day exclusion window. Do not recommend them as migration targets. See references/vendored/ai/ai-model-lifecycle.md for authoritative status (recomputed each run).
Recommendation: Default new Bedrock targets to Claude Sonnet 5 (flagship) / Claude Opus 4.8 (hardest reasoning) / Claude Haiku 4.5 (cost/speed). Converse API call shape is identical across generations. Do not default to Claude Fable 5 (frontier / Mythos-class pricing — opt-in only).
Before: anthropic.Anthropic(api_key=...)
After: boto3.client("bedrock-runtime", region_name="us-east-1")
Remove ANTHROPIC_API_KEY. Use IAM role with bedrock:InvokeModel.
Before: client.messages.create(model=..., max_tokens=1024, messages=[{"role": "user", "content": "Hello"}])
After: client.converse(modelId="anthropic.claude-sonnet-5", messages=[{"role": "user", "content": [{"text": "Hello"}]}], inferenceConfig={"maxTokens": 1024})
Key differences:
response["output"]["message"]["content"][0]["text"]Before: system="You are helpful" as a string param
After: system=[{"text": "You are helpful"}] as a list of blocks
Before: client.messages.stream() context manager
After: client.converse_stream() — iterate response["stream"] for contentBlockDelta events
Add bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream on arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-*
Request TPM increases via Service Quotas. Cross-region inference profiles (us.* prefix) have higher shared limits.