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

# TTS-1

> TTS-1 | 文字轉語音

文字轉語音 · `tts`

使用此完整 MixRoute 模型 ID 選擇路由。

`POST /v1/audio/speech`

請在 [MixRoute 模型廣場](https://console.mixroute.ai/models) 確認金鑰分組的可用性。列入目錄不代表路由已開放。

> [!WARNING]
>
> 此請求格式需要目前的 MixRoute 分組已啟用該模型的計費設定。如傳回 `model_price_error`，請聯絡 MixRoute 支援；調整提示詞無法開通路由。

## 快速範例

執行前請設定 `MIXROUTE_API_KEY`。

```bash theme={null}
curl --fail-with-body --request POST 'https://api.mixroute.ai/v1/audio/speech' \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header 'Content-Type: application/json' \
  --output speech.mp3 \
  --data '{
  "model": "tts",
  "input": "Hello.",
  "voice": "alloy",
  "response_format": "mp3"
}'
```

回應是音訊而非 JSON。範例會將音訊儲存為 `speech.mp3`。

## 參數

| 欄位 | 說明 |
| - | - |
| `model` | `tts`. 使用上方列出的完整模型 ID。 |
| `input` | 輸入文字。 |
| `voice` | 輸出語音的音色。 |

## API 參考

* [語音合成](https://mixroute.ai/docs/zh-Hant/api-reference/endpoint/audio-speech.md)


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