# Amazon Polly (/en/ai/platform/models/tts/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 provides natural-sounding text-to-speech with customizable voice instructions and multiple voice options.

## Sample configuration

The following example shows how to configure Amazon Polly as the agent's TTS 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 Polly supports BYOK only. It isn't available in managed mode. Store your AWS 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**

Store both the access key ID and the secret access key in the secret set, and pass a reference to each. In the following example, they're stored as `amazon_access_key_id` and `amazon` in the `support_prod` set:

```python
from agora_agent import Agent, AmazonTTS, secret_ref

# client is your configured Agora client
agent = (
    Agent(client=client)
    .with_stt(...)  # configure your ASR vendor
    .with_llm(...)  # configure your LLM vendor
    .with_tts(
        AmazonTTS(
            access_key=secret_ref("support_prod", "amazon_access_key_id"),
            secret_key=secret_ref("support_prod", "amazon"),
            region="<your_aws_region>",
            voice_id="Joanna",
            engine="neural",
        )
    )
)
```

**TypeScript SDK**

Store both the access key ID and the secret access key in the secret set, and pass a reference to each. In the following example, they're stored as `amazon_access_key_id` and `amazon` in the `support_prod` set:

```ts
import { Agent, AmazonTTS, secretRef } from 'agora-agents';

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(/* configure your ASR vendor */)
  .withLlm(/* configure your LLM vendor */)
  .withTts(
    new AmazonTTS({
      accessKey: secretRef('support_prod', 'amazon_access_key_id'),
      secretKey: secretRef('support_prod', 'amazon'),
      region: '<your_aws_region>',
      voiceId: 'Joanna',
      engine: 'neural',
    }),
  );
```

**Go SDK**

Store both the access key ID and the secret access key in the secret set, and pass a reference to each. In the following example, they're stored as `amazon_access_key_id` and `amazon` in the `support_prod` set:

```go
// client is your configured Agora client
agent := agentkit.NewAgent(client).
	WithStt( /* configure your ASR vendor */ ).
	WithLlm( /* configure your LLM vendor */ ).
	WithTts(vendors.NewAmazonTTS(vendors.AmazonTTSOptions{
		AccessKey: agentkit.SecretRef("support_prod", "amazon_access_key_id"),
		SecretKey: agentkit.SecretRef("support_prod", "amazon"),
		Region:    "<your_aws_region>",
		VoiceID:   "Joanna",
		Engine:    "neural",
	}))
```

**REST API**

Set `credential.mode` to `byok`, and set `credential.fields.aws_access_key_id` and `credential.fields.aws_secret_access_key` to references to your AWS access key ID and secret access key. Your AWS region isn't secret. Pass it in `params`. In the following example, the keys are stored as `amazon_access_key_id` and `amazon` in the `support_prod` set:

```json
"tts": {
  "credential": {
    "mode": "byok",
    "fields": {
      "aws_access_key_id": "$secrets.support_prod.amazon_access_key_id",
      "aws_secret_access_key": "$secrets.support_prod.amazon"
    }
  },
  "vendor": "amazon",
  "params": {
    "region_name": "<your_aws_region>",
    "voice": "Joanna",
    "engine": "neural"
  }
}
```

## Key parameters

The `tts` block takes the following fields. In the SDKs, `AmazonTTS` sets them from its options.

**tts**

**`vendor` (string) required**

Set to `amazon`.

**`credential` (object) required**

Set `mode` to `byok`, and set `fields.aws_access_key_id` and `fields.aws_secret_access_key` to `$secrets.<set>.<key>` references to your AWS access key ID and secret access key. Get both from the [AWS IAM Console](https://console.aws.amazon.com/iam/).

**`params` (object) required**

**`region_name` (string) required**

The AWS region where the Polly service is hosted, for example, `us-east-1`, `us-west-2`, or `eu-west-1`. See [AWS regions](https://docs.aws.amazon.com/general/latest/gr/pol.html) for available regions.

**`voice` (string) required**

The voice ID to use for speech synthesis, for example, `Joanna`, `Matthew`, or `Ivy`. See [available voices](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html) for supported voice IDs.

**`engine` (string) required**

The engine type to use for speech synthesis. Supported values: `standard`, `neural`, `long-form`, `generative`. See [engine documentation](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html) for details on each engine type.

> **Caution**
>
> The parameters listed on this page are validated for use with the Conversational AI Platform. Required parameters must be provided as documented. Any additional parameters in `params` are passed through directly to Amazon Polly without validation. For a full list of supported options, refer to the [Amazon Polly documentation](https://docs.aws.amazon.com/polly/latest/dg/what-is.html).

This integration is fully supported for use with the Conversational AI Platform. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
