## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.cognigy.com/llms.txt)

Use this file to discover all available pages before exploring further.

## Speech Services

**Speech services** integrate Speech-to-Text (STT) or Text-to-Speech (TTS) vendors in the Voice Gateway Self-Service Portal. To ensure the AI Agent gets a voice, a speech service must be selected within the [Application](https://docs.cognigy.com/voice-gateway/webapp/applications). By connecting with a speech vendor of your choice, you can select between multiple voices, genders, accents, and languages. You can add multiple speech vendors to the Voice Gateway Self-Service Portal, or install multiple configurations of one speech vendor, to quickly switch between different setups. Voice Gateway supports the following speech vendor configurations:

- [Cloud-based](https://docs.cognigy.com/voice-gateway/webapp/speech-services#cloud-based-speech-services)
- [On-premises](https://docs.cognigy.com/voice-gateway/webapp/speech-services#on-premises-speech-services)

For the list of supported vendors and their Speech-To-Text and Text-To-Speech capabilities, see the [TTS and STT Vendors](https://docs.cognigy.com/voice-gateway/references/tts-and-stt-vendors) reference.

### Cloud-Based Speech Services

To configure the connection for a cloud-based speech service:

1. In the left-side menu of the Voice Gateway Self-Service Portal, select **Speech**.
2. Click **Add Speech Service** and select your preferred vendor.
3. Select the account you want to use it with.
4. _(Optional)_ If you need to create multiple speech services from the same vendor, use the **Label** field to create a unique speech service.
5. Select **Speech-To-Text**, **Text-To-Speech** or both, depending on your use case.

1. _(Optional)_ If you enable TTS, the **Enable text-to-speech streaming** option appears. Activate this option to enable TTS streaming for your voice AI Agent. Note that some providers might not support TTS streaming. For more information, see [TTS Streaming](https://docs.cognigy.com/voice-gateway/streaming).
6. Follow further instructions according to your selected vendor:

- Amazon Polly
- Deepgram
- Deepgram Flux
- ElevenLabs
- Google
- Microsoft Azure
- Nuance
- Speechmatics

To use Amazon Polly as a TTS service, you need at least the following IAM policy:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "polly:SynthesizeSpeech",
        "polly:DescribeVoices"
      ],
      "Resource": "*"
    }
  ]
}
```
Where:

- `polly:SynthesizeSpeech` — allows the service to synthesize speech.
- `polly:DescribeVoices` — allows the service to list the available voices.
- `*` — allows the service to access all resources. AWS doesn’t support resource-level restrictions.

To use Amazon Polly’s speech services, you need to configure Amazon Transcribe’s STT policy to allow real-time streaming transcription. To do so, configure at least the following IAM policies:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "transcribe:StartStreamTranscription",
        "transcribe:StartStreamTranscriptionWebSocket"
      ],
      "Resource": "*"
    }
  ]
}
```
Where:

- `transcribe:StartStreamTranscription` — allows the service to start a real-time streaming transcription.
- `transcribe:StartStreamTranscriptionWebSocket` — allows the service to start a real-time streaming transcription via WebSocket.
- `*` — allows the service to access all resources. AWS doesn’t support resource-level restrictions.

2. Enter the Access Key in the **Access key ID** field. For more information on AWS Access Keys, read the [Amazon AWS](https://repost.aws/knowledge-center/create-access-key) documentation.
3. Enter the Secret Access Key in the **Secret access key** field.
4. Select a region from the **Region** list.

Use Deepgram for TTS. For STT capabilities, use Deepgram Flux, which is optimized for transcription accuracy, real-time streaming, and processing large volumes of audio.

### On-Premises Speech Services

1. In the left-side menu of the Voice Gateway Self-Service Portal, select **Speech**.
2. Click **Add Speech Service** and select your preferred vendor.
3. Select the account you want to use it with.
4. _(Optional)_ If you need to create multiple speech services from the same vendor, use the **Label** field to create a unique speech service.
5. Select **Speech-To-Text**, **Text-To-Speech** or both, depending on your use case.
6. _(Optional)_ If you enable TTS, the **Enable text-to-speech streaming** option appears. Activate this option to enable TTS streaming for your voice AI Agent. Note that some providers might not support TTS streaming. For more information, see [TTS Streaming](https://docs.cognigy.com/voice-gateway/streaming).

To add a custom speech vendor, follow these steps:

1. In the left-side menu of the Voice Gateway Self-Service Portal, select **Speech**.
2. On the **Speech services** page, click **Add speech service**.
3. On the **Add a speech service** page, select **Custom** from the **Vendor** list.
4. In the **Name** field, specify a unique name for your provider. You need to reuse this name in the Node configuration.
5. From the **Account** list, select a specific account or leave the **All accounts** value if you want the custom speech provider to be available for all accounts.
6. In the **Label** field, create a label only if you need to create multiple speech services from the same vendor. Then, in your [application](https://docs.cognigy.com/voice-gateway/webapp/applications#add-additional-tts-and-stt-vendor), use the label to specify which service to use.
7. Activate the **Use for text-to-speech** setting to use this provider as a TTS vendor. Enter the TTS HTTP URL of the server where your custom vendor is deployed.
8. Activate the **Use for speech-to-text** setting to use this provider as an STT vendor. Enter the STT WebSocket URL of the server where your custom vendor is deployed.
9. In the **Authentication Token** field, enter the key that you get from your TTS or STT vendor to set up a connection.
10. Click **Save**.

## More Information

- [TTS and STT Vendors](https://docs.cognigy.com/voice-gateway/references/tts-and-stt-vendors)
