外观
文字转语音
同步将文字合成为 MP3。
http
POST /v1/chat/speech| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
text | string | 是 | 需要朗读的文字 |
voice | string | 否 | DashScope 音色,如 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"}'返回的 audio 是 data:audio/mpeg;base64,...,可直接作为网页 <audio> 元素的 src。
