Skip to main content

AWS Claude

Use Anthropic’s Claude models through AWS Bedrock — same powerful Claude capabilities (extended thinking, document analysis, tool calling) but authenticated with AWS credentials and billed through your AWS account.
awsClaude() uses the @anthropic-ai/bedrock-sdk package, which provides the same Anthropic Messages API routed through AWS Bedrock. All Claude features (thinking, multi-modal, tool calling) work identically to the direct anthropic() provider.

Setup

Install the Anthropic Bedrock SDK:

Factory

string
required
The AWS Bedrock Claude model identifier. Use the us. or eu. prefix for cross-region inference.
AwsClaudeConfig
Optional configuration. See Config below.

Supported Models

Prefix the model ID with us. or eu. to use cross-region inference profiles. This routes requests to the nearest available region for lower latency:

Config

string
AWS access key ID. Falls back to AWS_ACCESS_KEY_ID env var.
string
AWS secret access key. Falls back to AWS_SECRET_ACCESS_KEY env var.
string
default:"us-east-1"
AWS region. Falls back to AWS_REGION env var.
string
AWS session token for temporary credentials. Falls back to AWS_SESSION_TOKEN env var.

Authentication Methods

Method 2: Explicit Credentials

Method 3: Temporary Credentials (STS / SSO)


Reasoning / Extended Thinking

Claude’s extended thinking works on Bedrock just like the direct API:
When reasoning is enabled, maxTokens is automatically adjusted to accommodate both thinking and response tokens. See Reasoning for details.

Tool Calling

Tool calling works identically to the direct Anthropic provider:

Multi-Modal Support

AWS Claude supports images and files/documents — same as the direct Anthropic provider.

Images

PDF Documents

CSV Data


Full Example


AWS Claude vs Direct Anthropic

Use awsClaude() when you need AWS billing, VPC isolation, or compliance certifications. Use anthropic() when you want the simplest setup with an API key.

Environment Variables


Cross-References