TTS

Generate and stream TTS audio

Changed on

Generate and stream TTS audio based on the provided text. Returns an audio stream in the specified format (default MP3). Supported formats: mp3, opus, mulaw. For wav or s16le output, use the WebSocket API.

post/tts

Request

  • Base URL
    https://restapi.deepdub.ai/api/v1
  • Auth
    API key in header x-api-key

Headers

x-api-keystring required

API Key

Request body

modelstring required

Model ID to use for generation

targetTextstring required

Text to be converted to speech

localestring required

Language locale code (e.g., en-US, fr-FR)

voicePromptIdstring required

ID of the voice prompt to use for generation

seedinteger

Random seed for deterministic generation. Applies to dd-etts-1.1 only — newer models do not use it, and setting it has no effect on their output.

Example request

{
  "model": "dd-etts-3.0",
  "targetText": "Hello world, welcome to Deepdub.",
  "locale": "en-US",
  "voicePromptId": "bd1b00bb-be1c-4679-8eaa-0fcbfd4ff773",
  "seed": 42
}

Response

Audio stream in the requested format (MP3, Opus, or mulaw depending on format parameter). The response body is raw audio bytes.

Changes

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status