# 文字转语音（TTS）

将文字转换为语音音频。计费方式：按字符数计费（含标点）。
响应为音频二进制流，`Content-Type` 随 `response_format` 变化。

请求体含 `model`（如 `seed-tts-2.0`）、`input`（待合成文本）、`voice`（音色 ID），
可选 `speed`（语速）、`response_format`（输出格式）、`instructions`（语音指令，不计费）。

需要火山原生参数（`ssml`/`explicit_language`/`aigc_watermark` 等）的场景，改用
`POST /v1/audio/speech/unidirectional` 原生透传端点。

## POST /v1/audio/speech

> Text-to-Speech (TTS)

Convert text to speech audio. Billing: charged per character count (punctuation
included). The response is a binary audio stream; `Content-Type` varies with
`response_format`.

The request body includes `model` (e.g. `seed-tts-2.0`), `input` (text to
synthesize), `voice` (voice ID), plus optional `speed` (speaking rate),
`response_format` (output format), and `instructions` (voice instructions,
not billed).

For native Volcengine parameters (`ssml`, `explicit_language`,
`aigc_watermark`, etc.), use the native passthrough endpoint
`POST /v1/audio/speech/unidirectional` instead.

### Authentication

`Authorization: Bearer tr-xxx`

### Request Body

Content-Type: `application/json`

- **model** `string` **(required)**  
  TTS model ID. Filter by `type: tts` via `GET /v1/models`.
- **input** `string` **(required)**  
  Text content to synthesize. Billed per character count
- **voice** `string`  
  Voice ID. Available voices for Volcengine models can be found at the [Voice List](https://www.volcengine.com/docs/6561/1257544).
- **speed** `number` (default: `1`)  
  Speaking rate, `0.25` (1/4x) to `4.0` (4x), default `1` (normal speed).
- **response_format** ``mp3` | `wav` | `pcm` | `opus`` (default: `mp3`)  
  Output audio format. `pcm` is raw unwrapped PCM
- **instructions** `string`  
  Voice instructions describing the desired tone / emotion / style in

### Response

Content-Type: `audio/mpeg` (binary audio stream)

### Error Codes

- `400`: Invalid request, or `response_format` was set to the unsupported `aac`/`flac`
- `401`: 
- `402`: 
- `429`: 
- `502`:
