Cipta pertuturan
post/v1/audio/speech
Tukar teks kepada audio.
Pengesahan
Hantar kunci API OLETOKEN sebagai token Bearer. Kunci dicipta di halaman Kunci API dalam konsol.
Authorization: Bearer $OLETOKEN_API_KEYIsi permintaan
Content-Type:application/json
| Medan | Jenis | Wajib | Keterangan |
|---|---|---|---|
| model | string | — | |
| input | string≤ 4096 | Teks untuk ditukar | |
| voice | stringalloyechofableonyxnovashimmer | — | |
| response_format | stringdefault: mp3mp3opusaacflacwavpcm | — | — |
| speed | number0.25–4default: 1 | — | — |
Respons
200Audio dijana
Respons ini tiada isi JSON.
Contoh permintaan
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"
}'
