# Amazon Bedrock (/en/ai/platform/models/llm/amazon)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI.
> Documentation version: Preview.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-guides-v2.txt).


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](/en/ai/platform/get-started/start-stop-agent#create-an-agent).

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](/en/ai/platform/build/use-your-own-keys).

**Python SDK**

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:

```python
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
)
```

**TypeScript SDK**

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:

```ts
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 */);
```

**Go SDK**

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:

```go
// 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 */ )
```

**REST API**

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:

```json
"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.

**llm**

**`vendor` (string) required**

Set to `amazon`.

**`credential` (object) required**

Set `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.

**`style` (string) required**

The API style to use. Set to `bedrock` for Amazon Bedrock models.

**`model` (string) required**

The Bedrock model ID, for example `us.anthropic.claude-sonnet-4-20250514-v1:0`.

**`url` (string) required**

The Amazon Bedrock runtime endpoint for the target region and model. See [Amazon Bedrock endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/bedrock.html#bedrock_region) for the correct endpoint format.

**`params` (object) required**

**`region` (string) required**

The AWS region hosting the Bedrock model, for example, `us-east-1` or `us-west-2`. See [Supported Regions and models](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html) for available regions.

For complete `llm` block options, see [Create an agent](/en/api-reference/api-ref/conversational-ai/platform/create-agent). For advanced configuration options, model capabilities, and detailed parameter descriptions, see the [Amazon Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html).
