customMode 切换。两种模式字段互斥,不要混传。ai-music-api/speech。customMode: false)customMode、prompt(1–3000 字符)prompt 是场景描述(Idea prompt),文稿由模型自写customMode=false + prompt,不要传 script / tone / variety / vocalGender / backgroundMusiccustomMode: true)customMode、script(1–5000 字符,要念的原文)tone(0–1000)、variety(0–4 整数)、vocalGender、backgroundMusicprompt,不要在 Advanced 下传 promptcustomMode=false + promptprompt,提交 customMode=true + script,其余可选| 情况 | 文案 |
|---|---|
| variety 超出 0–4 | variety must be between 0 and 4 |
| Simple 传了 variety | variety is only supported when customMode is true |
curl --location 'https://api.kie.ai/api/v1/jobs/createTask' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "ai-music-api/speech",
"callBackUrl": "https://your.domain/callback",
"input": {
"customMode": false,
"prompt": "A short morning news intro about sunny weather"
}
}'{
"code": 200,
"msg": "success",
"data": {
"taskId": "xxxxxxxx",
"recordId": "123456"
}
}