AWS Bedrock Claude

Configuration reference for the Bedrock Claude model class, Agno's wrapper for Anthropic Claude models hosted on AWS Bedrock.

The AWS Bedrock Claude model provides access to Anthropic's Claude models hosted on AWS Bedrock.

Parameters

ParameterTypeDefaultDescription
idstr"global.anthropic.claude-sonnet-4-5-20250929-v1:0"The ID of the AWS Bedrock Claude model to use
namestr"AwsBedrockAnthropicClaude"The name of the model
providerstr"AwsBedrock"The provider of the model
aws_access_keyOptional[str]NoneAWS access key (defaults to AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY env var)
aws_secret_keyOptional[str]NoneAWS secret key (defaults to AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY env var)
aws_session_tokenOptional[str]NoneAWS session token (defaults to AWS_SESSION_TOKEN env var)
aws_regionOptional[str]NoneThe AWS region to use (defaults to AWS_REGION env var)
sessionOptional[Session]Noneboto3 session for credential resolution. Credentials are re-resolved on each request, so rotated credentials (IAM roles, instance profiles, STS) keep working
max_tokensOptional[int]8192Maximum number of tokens to generate in the chat completion
thinkingOptional[Dict[str, Any]]NoneConfiguration for the thinking (reasoning) process
temperatureOptional[float]NoneControls randomness in the model's output
stop_sequencesOptional[List[str]]NoneA list of strings that the model should stop generating text at
top_pOptional[float]NoneControls diversity via nucleus sampling
top_kOptional[int]NoneControls diversity via top-k sampling
cache_system_promptOptional[bool]FalseWhether to cache the system prompt for improved performance
extended_cache_timeOptional[bool]FalseWhether to use extended cache time (1 hour instead of default)
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for client configuration
retriesint0Number of retries to attempt before raising a ModelProviderError
delay_between_retriesint1Delay between retries, in seconds
exponential_backoffboolFalseIf True, the delay between retries is doubled each time

AWS Bedrock Claude extends the Anthropic Claude model and accepts all of its parameters. Native structured outputs and JSON schema outputs are disabled on Bedrock.

The inherited api_key parameter is not supported for Bedrock authentication. Setting it (directly or via AWS_BEDROCK_API_KEY) without a session raises a ValueError. Authenticate with aws_access_key/aws_secret_key, the AWS environment variables, or a boto3 session instead.