Generic TTS

Updated

Integrate a custom TTS service using the OpenAI TTS protocol into Conversational AI Engine.

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.

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)

    "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

    "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
ParameterDescription
urlstring
required

The OpenAI TTS protocol compatible service endpoint.

headersobject
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.

paramsobject
required
  • Optional api_key?: string

    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.

  • Optional model?: string

    The name of the TTS model.

  • Optional voice?: string

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

  • Optional speed?: number

    The speech rate.

  • Optional sample_rate?: integer
    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.

  • Optional response_format?: string
    Default value
    pcm

    The output audio format. Currently only pcm is supported.

  • Optional instructions?: string

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

  • Optional enable_request_id?: boolean
    Default value
    false

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

The table extends beyond the current width. Scroll horizontally to view more columns.

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.