> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hubto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 文本转语音

> 文本转语音接口。

## 用途

用于把输入文本合成为语音。

## 请求头

<ParamField header="Authorization" type="string" default="Bearer YOUR_API_KEY" required>
  Bearer 鉴权请求头。
</ParamField>

## 请求体

<ParamField body="model" type="string" default="gpt-5.4-tts" required>
  语音模型名称。
</ParamField>

<ParamField body="voice" type="string" default="alloy" required>
  音色名称。
</ParamField>

<ParamField body="input" type="string" default="欢迎使用 HubTo。" required>
  待合成文本。
</ParamField>

<ParamField body="response_format" type="string" default="mp3">
  可选，输出音频格式。
</ParamField>

<ParamField body="speed" type="number" default="1.0">
  可选，语速倍率。
</ParamField>

## 示例请求体

```json theme={null}
{
  "model": "gpt-5.4-tts",
  "voice": "alloy",
  "input": "欢迎使用 HubTo。"
}
```

## 响应

<ResponseField name="audio" type="binary">
  合成后的音频内容。
</ResponseField>
