Chuyển đến nội dung chính
POST
/
v1
/
audio
/
speech
curl -X POST "https://api.lemondata.cc/v1/audio/speech" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1-hd",
    "voice": "nova",
    "input": "Hello, welcome to LemonData!"
  }' \
  --output speech.mp3

Request Body

model
string
mặc định:"tts-1"
Mô hình TTS: tts-1 (tiêu chuẩn) hoặc tts-1-hd (chất lượng cao).
input
string
bắt buộc
Văn bản cần tạo âm thanh. Tối đa 4096 ký tự.
voice
string
bắt buộc
Giọng nói sử dụng: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse.
response_format
string
mặc định:"mp3"
Định dạng âm thanh: mp3, opus, aac, flac, wav, pcm.
speed
number
mặc định:"1.0"
Tốc độ âm thanh (0.25 đến 4.0).

Phản hồi

Trả về tệp âm thanh theo định dạng đã yêu cầu.
curl -X POST "https://api.lemondata.cc/v1/audio/speech" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1-hd",
    "voice": "nova",
    "input": "Hello, welcome to LemonData!"
  }' \
  --output speech.mp3

Mẫu giọng nói

Giọng nóiMô tả
alloyTrung tính, cân bằng
ashĐiềm tĩnh, chừng mực
balladTruyền cảm, biểu cảm
coralẤm áp, lôi cuốn
echoẤm áp, tự nhiên như trò chuyện
fableBiểu cảm, mang tính tự sự
novaThân thiện, rõ ràng
onyxTrầm, uy quyền
sageThông thái, sâu sắc
shimmerNhẹ nhàng, dịu dàng
verseNăng động, linh hoạt