> ## 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`

API キーのグループで利用できるモデルは [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/ja/api-reference/endpoint/audio-speech.md)


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