Skip to main content

AWS Bedrock

Use AWS Bedrock to access a broad catalog of foundation models — Mistral, Amazon Nova, Meta Llama, Cohere, AI21, and more — through Agentium’s unified ModelProvider interface. All models are accessed via the Bedrock Converse API.
For Claude models on Bedrock, use the dedicated awsClaude() provider instead. It uses the native Anthropic SDK for full Claude feature support (extended thinking, document input, etc.).

Setup

Install the AWS Bedrock Runtime SDK:

Factory

string
required
The Bedrock model identifier. Find model IDs in the AWS Bedrock model catalog.
AwsBedrockConfig
Optional configuration. See Config below.

Supported Models

Pass any valid Bedrock model ID to the factory. Manage model access in the AWS Bedrock console. Not all models support all features — check supported features per model.

Config

string
AWS access key ID. Falls back to AWS_ACCESS_KEY_ID env var, then default credential chain.
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 (STS, SSO). Falls back to AWS_SESSION_TOKEN env var.

Authentication Methods

Method 1: Access Key + Secret (Explicit)

Method 3: Default Credential Chain (SSO, IAM Roles)

If running on EC2, ECS, Lambda, or using aws sso login, credentials are resolved automatically via the AWS SDK’s default credential provider chain:

Method 4: Temporary Credentials (STS)


Tool Calling

Tool calling is supported via the Bedrock Converse API. Define tools with defineTool and they work automatically:
Not all Bedrock models support tool calling. Mistral Large, Amazon Nova, Cohere Command R/R+, and Meta Llama 3.1+ support function calling. Check the Bedrock docs for your model.

Multi-Modal Support

The Bedrock Converse API supports images and documents for models that have vision capabilities (e.g., Amazon Nova).

Images

Documents


Full Example


AWS Bedrock vs Direct API


Environment Variables


Cross-References