建立語音
post/v1/audio/speech
將文字轉換為音訊。
驗證
把 OLETOKEN 的 API Key 作為 Bearer Token 放進 Authorization 請求標頭。金鑰在控制台的「API 金鑰」頁建立。
Authorization: Bearer $OLETOKEN_API_KEY請求主體
Content-Type:application/json
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
| model | string | — | |
| input | string≤ 4096 | 要轉換的文字 | |
| voice | stringalloyechofableonyxnovashimmer | — | |
| response_format | stringdefault: mp3mp3opusaacflacwavpcm | — | — |
| speed | number0.25–4default: 1 | — | — |
回應
200已生成音訊
此回應沒有 JSON 回應主體。
請求範例
curl -X POST 'https://api.oletoken.ai/v1/audio/speech' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "tts-1",
"input": "string",
"voice": "alloy"
}'
