สร้างเสียงพูด
post/v1/audio/speech
แปลงข้อความเป็นเสียง
การยืนยันตัวตน
ส่งคีย์ API ของ OLETOKEN เป็น Bearer token สร้างคีย์ได้ที่หน้า API Keys ในคอนโซล
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"
}'
