# Generic TTS (/en/ai/models/tts/generic-http)

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

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


The `generic_http` TTS vendor lets you integrate a custom TTS service that implements the OpenAI TTS protocol into the Conversational AI Engine. For a walkthrough of preparing and verifying a compatible TTS service, see [Connect your own TTS service](/en/ai/build/custom-model-integration/custom-tts).

### Sample configuration

Use the following `tts` configuration when starting a conversational AI agent using the REST API. `generic_http` requires `tts.url`, and at least one of `tts.headers.Authorization` or `tts.params.api_key` for authentication.

- **Authenticate using `headers`** (recommended)

  ```json
  "tts": {
    "vendor": "generic_http",
    "url": "https://your-tts-service.example.com/v1/audio/speech",
    "headers": {
      "Authorization": "Bearer your_tts_api_key"
    },
    "params": {
      "model": "gpt-4o-mini-tts",
      "voice": "alloy",
      "speed": 1.0,
      "sample_rate": 16000,
      "response_format": "pcm",
      "instructions": "calm",
      "enable_request_id": false
    }
  }
  ```


- **Authenticate using `params.api_key`**

  ```json
  "tts": {
    "vendor": "generic_http",
    "url": "https://your-tts-service.example.com/v1/audio/speech",
    "params": {
      "api_key": "your_tts_api_key",
      "model": "gpt-4o-mini-tts",
      "voice": "alloy",
      "speed": 1.0,
      "sample_rate": 16000,
      "response_format": "pcm",
      "instructions": "calm",
      "enable_request_id": false
    }
  }
  ```


  If you provide both `tts.headers.Authorization` and `tts.params.api_key`, the Conversational AI Engine uses `tts.headers.Authorization`.

### Key parameters

**tts required**

**`url` (string) required**

The OpenAI TTS protocol compatible service endpoint.

**`headers` (object) optional**

Custom request headers to include in requests to the TTS service, such as authentication credentials. Provide at least one of `headers.Authorization` or `params.api_key`. If you provide both, the Conversational AI Engine uses `headers.Authorization`.

**`params` (object) required**

**`api_key` (string) optional**

The API key used to authenticate with the TTS service. Provide at least one of `headers.Authorization` or `params.api_key`. If you provide both, the Conversational AI Engine uses `headers.Authorization`.

**`model` (string) optional**

The name of the TTS model.

**`voice` (string) optional**

The voice name. Omit this parameter if your TTS service does not support multiple voices.

**`speed` (number) optional**

The speech rate.

**`sample_rate` (integer) optional**

Default value: `16000`

The sample rate, in Hz, of the output audio. If your TTS service does not support multiple sample rates, make sure the sample rate of the returned audio matches this value.

**`response_format` (string) optional**

Default value: `pcm`

The output audio format. Currently only `pcm` is supported.

**`instructions` (string) optional**

Instructions for voice style, emotion, or other playback directives.

**`enable_request_id` (boolean) optional**

Default value: `false`

Whether to include `request_id`, `request_seq_id`, and `request_end` in the TTS request body.

> **Caution**
>
> Your TTS service must implement the OpenAI TTS protocol. The parameters listed on this page are validated for use with Conversational AI Engine. Any additional fields in `params` are passed through directly to your TTS service without validation.

This integration is fully supported for use with Conversational AI Engine. 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.
