gpt-4o-mini-ttsを呼び出します。
主な機能
- 音声合成 - テキストを生成音声に変換
- 音声の選択 - プリセットの音声を設定
- 音声出力 - 生成した音声データを返す
簡単な使用例
- cURL
- Python
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
GPT-4o Mini TTS: テキスト読み上げモデル。MixRouteでのリクエスト例とパラメーター。
gpt-4o-mini-ttsを呼び出します。
curl "https://api.mixroute.ai/v1/audio/speech" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini-tts",
"voice": "alloy",
"input": "Welcome to MixRoute.",
"response_format": "wav"
}' \
--output speech.wav
from pathlib import Path
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai/v1")
with client.audio.speech.with_streaming_response.create(
model="gpt-4o-mini-tts",
voice="alloy",
input="Welcome to MixRoute.",
response_format="wav",
) as response:
response.stream_to_file(Path("speech.wav"))
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | gpt-4o-mini-ttsである必要があります。 |
input | string | はい | 音声合成するテキスト。 |
voice | string | はい | 音声生成に使用する声。 |
response_format | string | いいえ | 音声の出力形式。 |