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

# TTS-1

TTS-1 是 OpenAI 提供的文本转语音模型，能够将文本内容合成为语音。

`tts-1` 模型的延迟较低，但音质不及 `tts-1-hd` 模型。

### 模型参数

* 模型ID：`tts-1`/`tts-1-hd`/`gpt-4o-mini-tts`
* 模型价格：参考模型详情页：[TTS-1](https://geekai.co/models/tts-1)、[TTS-1-HD](https://geekai.co/models/tts-1-hd)、[GPT-4o-Mini TTS](https://geekai.co/models/gpt-4o-mini-tts)
* 调用入口：`https://geekai.co/api/v1/audio/speech`
* 模型参数：参考[文本转语音 API 手册](https://docs.geekai.co/cn/api/audio/texttospeech.md)
* API认证：[获取 API KEY](https://geekai.co/user/api_keys)

> [!NOTE]
>
> 附：[TTS-1 官方 API 文档](https://developers.openai.com/api/docs/guides/text-to-speech)

### 模型价格

TTS-1 按照待生成语音的文本字符数计费，价格表如下：

| 模型 | 模型价格（单位：元/百万字符） |
| - | - |
| tts-1 | 112.50 |
| tts-1-hd | 225.00 |

GPT-4o-Mini TTS 模型按照生成语音的时长计费，价格表如下：

| 模型 | 模型价格（单位：元/分钟） |
| - | - |
| gpt-4o-mini-tts | 0.112 |

使用极客智坊提供的[低价代理渠道](https://docs.geekai.co/cn/docs/model_price.md)调用时，不同参数对应价格按照价格表x对应的折扣值即可：以高可用通道为例，折扣值是 `0.5`，那么通过 `tts-1` 模型将10000字符转化为语音的价格是 `112.50 x 10000 / 1000000 x 0.5 = 0.5625` 元。其他参数依次类推。

### 调用示例

```bash theme={null}
curl https://geekai.co/api/v1/audio/speech \
  -H "Authorization: Bearer $GEEKAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Today is a wonderful day to build something people love!",
    "voice": "coral",
    "instructions": "Speak in a cheerful and positive tone."
  }' \
  --output speech.mp3
```

模型默认以 MP3 二进制语音文件返回生成音频，你可以通过 `response_format` 参数指定返回格式，可选值如下：

* `mp3`
* `opus`
* `aac`
* `flac`
* `wav`
* `pcm`

为获得最快的响应速度，建议使用 `wav` 或 `pcm` 作为响应格式。

你还可以通过 `voice` 参数指定音频使用的音色ID，TTS-1 和 TTS-1-HD 模型支持以下音色：

* `alloy`
* `ash`
* `coral`
* `echo`
* `fable`
* `onyx`
* `nova`
* `sage`
* `shimmer`

GPT-4o-Mini TTS 模型在上述音色基础上新增了新的音色：

* `ballad`
* `verse`
* `marin`
* `cedar`

> [!NOTE]
>
> `tts-1`、`tts-1-hd` 和 `gpt-4o-mini-tts` 模型均已弃用，并将于 2027 年 1 月 6 日停止服务。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.