Amazon Bedrock
Updated
Use Amazon Bedrock as the LLM in a Conversational AI Platform agent.
Preview documentation
Amazon Bedrock provides access to a variety of foundation models (FMs) from leading AI providers through a fully managed AWS service.
Sample configuration
The following example shows how to configure Amazon Bedrock as the agent's LLM when you create or update an agent. For a complete example, see Create an agent and start a session.
Amazon Bedrock supports BYOK only. It isn't available in managed mode. Store your Bedrock credentials in a secret set, and refer to them from the agent. For details, see Use your own provider keys.
The SDK authenticates with an AWS access key ID and secret access key instead of a Bedrock API key. Store both in a secret set, and pass a reference to each:
from agora_agent import Agent, AmazonBedrock, secret_ref
# client is your configured Agora client
agent = (
Agent(client=client)
.with_stt(...) # configure your ASR vendor
.with_llm(
AmazonBedrock(
access_key=secret_ref("support_prod", "aws_access_key_id"),
secret_key=secret_ref("support_prod", "aws_secret_access_key"),
region="us-east-1",
model="us.anthropic.claude-sonnet-4-20250514-v1:0",
system_messages=[
{"role": "system", "content": "You are a friendly support agent for Acme. Keep your answers short."}
],
)
)
.with_tts(...) # configure your TTS vendor
)The SDK authenticates with an AWS access key ID and secret access key instead of a Bedrock API key. Store both in a secret set, and pass a reference to each:
import { Agent, AmazonBedrock, secretRef } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your ASR vendor */)
.withLlm(
new AmazonBedrock({
accessKey: secretRef('support_prod', 'aws_access_key_id'),
secretKey: secretRef('support_prod', 'aws_secret_access_key'),
region: 'us-east-1',
model: 'us.anthropic.claude-sonnet-4-20250514-v1:0',
systemMessages: [
{ role: 'system', content: 'You are a friendly support agent for Acme. Keep your answers short.' },
],
}),
)
.withTts(/* configure your TTS vendor */);The SDK authenticates with an AWS access key ID and secret access key instead of a Bedrock API key. Store both in a secret set, and pass a reference to each:
// client is your configured Agora client
agent := agentkit.NewAgent(client).
WithStt( /* configure your ASR vendor */ ).
WithLlm(vendors.NewAmazonBedrock(vendors.AmazonBedrockOptions{
AccessKey: agentkit.SecretRef("support_prod", "aws_access_key_id"),
SecretKey: agentkit.SecretRef("support_prod", "aws_secret_access_key"),
Region: "us-east-1",
Model: "us.anthropic.claude-sonnet-4-20250514-v1:0",
SystemMessages: []map[string]interface{}{
{"role": "system", "content": "You are a friendly support agent for Acme. Keep your answers short."},
},
})).
WithTts( /* configure your TTS vendor */ )Set credential.mode to byok and credential.fields.api_key to a reference to your Bedrock API key. To use an AWS access key pair instead, set credential.fields.access_key and credential.fields.secret_key. Your AWS region isn't secret. Pass it in params. In the following example, the key is stored as bedrock in the support_prod set:
"llm": {
"credential": {
"mode": "byok",
"fields": {
"api_key": "$secrets.support_prod.bedrock"
}
},
"vendor": "amazon",
"style": "bedrock",
"model": "us.anthropic.claude-sonnet-4-20250514-v1:0",
"url": "https://bedrock-runtime.us-east-1.amazonaws.com/model/us.anthropic.claude-sonnet-4-20250514-v1:0/converse-stream",
"params": {
"region": "us-east-1"
}
}Set the system prompt and the greeting with the agent's instructions and greeting, not in the llm block.
Key parameters
The llm block takes the following fields. In the SDKs, the LLM class sets them from its options.
vendorstringSet to amazon.
credentialobjectSet mode to byok and fields.api_key to a $secrets.<set>.<key> reference to your Bedrock API key, or set fields.access_key and fields.secret_key to references to an AWS access key pair.
stylestringThe API style to use. Set to bedrock for Amazon Bedrock models.
modelstringThe Bedrock model ID, for example us.anthropic.claude-sonnet-4-20250514-v1:0.
urlstringThe Amazon Bedrock runtime endpoint for the target region and model. See Amazon Bedrock endpoints and quotas for the correct endpoint format.
paramsobjectregionstringThe AWS region hosting the Bedrock model, for example, us-east-1 or us-west-2. See Supported Regions and models for available regions.
For complete llm block options, see Create an agent. For advanced configuration options, model capabilities, and detailed parameter descriptions, see the Amazon Bedrock documentation.
