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

# Audio · Speech

> 使用文本转语音接口生成 MP3/PCM 音频，可自定义音色与格式。

`POST /v1/audio/speech` 返回二进制音频流。支持 `gpt-4o-mini-tts`、`gpt-4o-audio-preview` 等模型。

## 请求示例（cURL）

```bash theme={null}
curl -X POST "$BASE_URL/v1/audio/speech" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini-tts",
    "voice": "alloy",
    "input": "你好，欢迎使用 HingNet AI！"
  }' \
  --output onehub-tts.mp3
```

## 参数速览

* `voice`：音色 ID，兼容 OpenAI 官网上所有可用选项。
* `response_format`：控制输出封装，例如 `mp3-1-32000-128000`、`wav` 等。
* `speed`：语速（0.25 \~ 4）。

<Callout type="tip">
  如果希望直接返回音频 URL，可结合 HingNet AI 的媒体存储服务或使用 MiniMaxi 文档中的 `files/retrieve` 接口。
</Callout>
