สร้างเสียงพูด

post/v1/audio/speech

แปลงข้อความเป็นเสียง

การยืนยันตัวตน

ส่งคีย์ API ของ OLETOKEN เป็น Bearer token สร้างคีย์ได้ที่หน้า API Keys ในคอนโซล

Authorization: Bearer $OLETOKEN_API_KEY

เนื้อหาคำขอ

Content-Type:application/json

ฟิลด์ประเภทจำเป็นคำอธิบาย
modelstring
inputstring≤ 4096ข้อความที่ต้องการแปลง
voicestringalloyechofableonyxnovashimmer
response_formatstringdefault: mp3mp3opusaacflacwavpcm
speednumber0.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"
  }'