---
title: "Generate and stream TTS audio"
method: POST
path: "/tts"
tags: ["TTS"]
---

# Generate and stream TTS audio

`POST /tts`

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.

## Headers

- `x-api-key` string, required

## Request body

- ModelGenerationRequest — Request structure for TTS generation endpoints. **Optional parameters** (not shown in playground): `generationId` (string), `targetDuration` (number, seconds), `tempo` (number, 0.5–2.0), `variance` (number, 0.0–1.0), `seed` (integer), `temperature` (number, 0.0–1.0), `sampleRate` (integer), `format` (string: mp3/opus/mulaw — default mp3), `promptBoost` (boolean), `superStretch` (boolean), `realtime` (boolean), `cleanAudio` (boolean, default true), `autoGain` (boolean), `publish` (boolean), `accentControl` (object with accentBaseLocale, accentLocale, accentRatio), `performanceReferencePromptId` (string), `voiceReference` (string, base64-encoded audio), `targetGender` (string: male/female — used for language-specific handling such as Hebrew diacritics; any other value returns 400).
  - `model` string, required — Model ID to use for generation
  - `targetText` string, required — Text to be converted to speech
  - `locale` string, required — Language locale code (e.g., en-US, fr-FR)
  - `voicePromptId` string, required — ID of the voice prompt to use for generation

## Response `200`

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

## Other responses

- `400` — Bad request — invalid or missing parameters
- `401` — Unauthorized — invalid or missing API key
- `402` — Insufficient credits — your account has run out of TTS credits
- `429` — Rate limit exceeded — too many concurrent requests
- `500` — Internal server error

---

[API](https://skmtc.dev/deepdub-ai/apis/deepdub-api.md) · [All operations](https://skmtc.dev/deepdub-ai/apis/deepdub-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/deepdub-ai/deepdub-api/revisions/903a930c3849/schema)
