# Text-to-Speech (TTS) Endpoints

OpenAI-compatible text-to-speech: `POST /v1/audio/speech`.

### 1. Speech Synthesis
* **Path**: `/v1/audio/speech`
* **Request Method**: `POST`

#### Request Parameters
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `model` | `string` | Yes | TTS model name, e.g., `tts-1` (OpenAI), `seed-tts-2.0` (Volcengine Speech LLM) |
| `input` | `string` | Yes | The text to be synthesized into speech. The maximum length is determined by the specific model specifications |
| `voice` | `string` | Yes | Voice identity/timbre. For Volcengine Ark, pass the speaker ID (e.g., `zh_female_vv_uranus_bigtts`) |
| `response_format` | `string` | No | Audio format. Options: `mp3` (default), `opus`, `aac`, `flac`, `wav`, `pcm` |
| `speed` | `number` | No | Speed adjustment factor (`0.25` to `4.0`, default is `1.0`) |

#### Calling Example
```bash
curl -X POST https://www.tokenpad.ai/v1/audio/speech \
  -H "Authorization: Bearer sk-your_token" \
  -H "Content-Type: application/json" \
  -o output.mp3 \
  -d '{
    "model": "seed-tts-2.0",
    "input": "Hello, welcome to the unified intelligent text-to-speech system. Please enter the text you wish to synthesize below.",
    "voice": "zh_female_vv_uranus_bigtts",
    "response_format": "mp3"
  }'
```

> [!NOTE]
> The gateway returns a raw binary audio stream for this endpoint (HTTP binary response with `Content-Type` set to `audio/mpeg` or the corresponding audio format). It returns a binary audio stream that can be saved directly as a file for playback.