跳轉到主要內容
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

請求主體

model
string
預設值:"tts-1"
TTS 模型:tts-1(標準)或 tts-1-hd(高品質)。
input
string
必填
要生成音訊的文字。最多 4096 個字元。
voice
string
必填
使用的聲音:alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse
response_format
string
預設值:"mp3"
音訊格式:mp3, opus, aac, flac, wav, pcm
speed
number
預設值:"1.0"
音訊速度(0.25 至 4.0)。

回應

以要求的格式傳回音訊檔案。
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

聲音範例

聲音描述
alloy中性、平衡
ash冷靜、沉穩
ballad悅耳、富有表現力
coral溫暖、親切
echo溫暖、對話式
fable富有表現力、敘事性
nova友好、清晰
onyx深沉、權威
sage睿智、深思熟慮
shimmer柔和、溫柔
verse動態、多才多藝