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_KEYNội dung yêu cầu
Content-Type:application/json
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
| model | string | — | |
| input | string≤ 4096 | Văn bản cần chuyển đổi | |
| voice | stringalloyechofableonyxnovashimmer | — | |
| response_format | stringdefault: mp3mp3opusaacflacwavpcm | — | — |
| speed | number0.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"
}'
