defaultParamFlag 为 true(自定义参数模式)时:instrumental: true:需要提供 style、title 和 uploadUrl,无需提供 prompt 和 vocalGenderinstrumental: false:需要提供 style、title 和 uploadUrl;prompt 为选填,提供后将作为提示词使用;无需提供 vocalGendercontinueAt:音频开始扩展的时间点(秒),需大于 0 且小于上传音频的总时长uploadUrl:音频文件地址,音频长度不能超过 8 分钟defaultParamFlag 为 false(非自定义参数模式)时:instrumental 设置如何,只需提供 uploadUrlprompt 为选填,提供后将作为提示词使用instrumental 为 true 时,无需提供 prompt 和 vocalGenderinstrumental 为 false 且未提供 prompt 时,将自动生成歌词uploadUrl 提供有效的音频 URL。| 参数名 | 类型 | 说明 |
|---|---|---|
prompt | string | 描述音乐应如何延长。提供后将作为提示词使用。当 instrumental 为 true 时无需提供。 |
vocalGender | string | 人声性别偏好。m 代表男声,f 代表女声。此接口无需提供。 |
styleWeight | number | 风格遵循强度,范围为 0–1,保留两位小数。示例:0.65。 |
weirdnessConstraint | number | 创意程度,范围为 0–1,保留两位小数。示例:0.65。 |
audioWeight | number | 音频要素权重,范围为 0–1,保留两位小数。示例:0.65。 |
personaId | string | 仅在 defaultParamFlag 为 true 时可用。生成 personaId 请访问 生成 Persona。 |
curl --location 'https://api.kie.ai/api/v1/generate/upload-extend' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"uploadUrl": "https://storage.example.com/upload",
"defaultParamFlag": true,
"instrumental": true,
"continueAt": 60,
"model": "V4",
"callBackUrl": "https://api.example.com/callback",
"prompt": "Extend the music with more relaxing notes",
"style": "Classical",
"title": "Peaceful Piano Extended",
"negativeTags": "Relaxing Piano",
"vocalGender": "m",
"styleWeight": 0.65,
"weirdnessConstraint": 0.65,
"audioWeight": 0.65,
"personaId": "persona_123",
"personaModel": "style_persona"
}'{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}