Skip to content

文字转语音

同步将文字合成为 MP3。

http
POST /v1/chat/speech
参数类型必填说明
textstring需要朗读的文字
voicestringDashScope 音色,如 Cherry;不传使用后台默认音色
bash
curl -X POST https://api.modelgo.moneygo.ai/v1/chat/speech \
  -H "Authorization: Bearer sk-你的Key" \
  -H "Content-Type: application/json" \
  -d '{"text":"API 接入成功","voice":"Cherry"}'

返回的 audiodata:audio/mpeg;base64,...,可直接作为网页 <audio> 元素的 src