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 | 否 | 音訊輸出格式。 |