Tạo giọng nói

post/v1/audio/speech

Chuyển văn bản thành âm thanh.

Xác thực

Gửi khóa API OLETOKEN dưới dạng token Bearer. Khóa được tạo tại trang API Keys trong bảng điều khiển.

Authorization: Bearer $OLETOKEN_API_KEY

Nội dung yêu cầu

Content-Type:application/json

TrườngKiểuBắt buộcMô tả
modelstring—
inputstring≤ 4096Văn bản cần chuyển đổi
voicestringalloyechofableonyxnovashimmer—
response_formatstringdefault: mp3mp3opusaacflacwavpcm——
speednumber0.25–4default: 1——

Phản hồi

200Đã tạo âm thanh

Phản hồi này không có nội dung JSON.

Ví dụ yêu cầu

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"
  }'