AWS Claude

Use Claude models through AWS Bedrock with Agno agents.

Use Claude models through AWS Bedrock. This integration uses the Anthropic SDK's Bedrock client. For other Bedrock foundation models, see AWS Bedrock.

We recommend experimenting to find the best-suited model for your use case. Here are some general recommendations:

  • global.anthropic.claude-sonnet-5 is the latest Sonnet model (Claude Sonnet 5).
  • global.anthropic.claude-sonnet-4-5-20250929-v1:0 is good for most use cases and supports image input.
  • us.anthropic.claude-haiku-4-5-20251001-v1:0 is Anthropic's fastest model.

Installation

uv pip install -U 'anthropic[bedrock]' agno

Authentication

AWS Claude supports two authentication methods:

Set your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_REGION environment variables.

Get your keys from here.

export AWS_ACCESS_KEY_ID="your_value_here"
export AWS_SECRET_ACCESS_KEY="your_value_here"
export AWS_REGION="your_value_here"

Or pass them directly:

from agno.agent import Agent
from agno.models.aws import Claude

agent = Agent(
    model=Claude(
        id="global.anthropic.claude-sonnet-4-5-20250929-v1:0",
        aws_access_key="your-access-key",
        aws_secret_key="your-secret-key",
        aws_region="us-east-1"
    )
)

Method 2: Boto3 Session

Use a pre-configured boto3 Session for advanced authentication scenarios:

from boto3.session import Session
from agno.agent import Agent
from agno.models.aws import Claude

# Create a boto3 session with your preferred authentication
session = Session(
    aws_access_key_id="your-access-key",
    aws_secret_access_key="your-secret-key",
    region_name="us-east-1"
)

agent = Agent(
    model=Claude(
        id="global.anthropic.claude-sonnet-4-5-20250929-v1:0",
        session=session
    )
)

The authentication methods are checked in this order: Session → Access Key/Secret Key. The first available method will be used. AWS Bedrock API key authentication (AWS_BEDROCK_API_KEY) is not currently supported and raises an error if set without a supplied boto3 Session.

Example

Use Claude with your Agent:

from agno.agent import Agent
from agno.models.aws import Claude

agent = Agent(
    model=Claude(id="global.anthropic.claude-sonnet-4-5-20250929-v1:0"),
    markdown=True
)

# Print the response on the terminal
agent.print_response("Share a 2 sentence horror story.")
View more examples here.

Parameters

ParameterTypeDefaultDescription
idstr"global.anthropic.claude-sonnet-4-5-20250929-v1:0"The specific AWS Bedrock Claude model ID to use
namestr"AwsBedrockAnthropicClaude"The name identifier for the AWS Bedrock Claude model
providerstr"AwsBedrock"The provider of the model
api_keyOptional[str]NoneNot currently supported. Setting it (or the AWS_BEDROCK_API_KEY env var) raises an error when no boto3 Session is supplied; use IAM credentials or a boto3 session instead
aws_access_keyOptional[str]NoneThe AWS access key to use (defaults to AWS_ACCESS_KEY_ID, then AWS_ACCESS_KEY env var)
aws_secret_keyOptional[str]NoneThe AWS secret key to use (defaults to AWS_SECRET_ACCESS_KEY, then AWS_SECRET_KEY env var)
aws_session_tokenOptional[str]NoneThe AWS session token for temporary credentials (defaults to AWS_SESSION_TOKEN env var)
aws_regionOptional[str]NoneThe AWS region to use (defaults to AWS_REGION env var)
sessionOptional[Session]NoneA boto3 Session object to use for authentication
max_tokensOptional[int]8192Maximum number of tokens to generate in the chat completion
temperatureOptional[float]NoneControls randomness in the model's output
top_pOptional[float]NoneControls diversity via nucleus sampling
top_kOptional[int]NoneControls diversity via top-k sampling
stop_sequencesOptional[List[str]]NoneA list of strings that the model should stop generating text at
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for client configuration

Claude (AWS) extends the Anthropic Claude model with AWS Bedrock integration and has access to most of the same parameters.