使用AI模型通过组合多个音频轨道创建混音音乐。
upload_url_list 需传 2 个音频 URL,上游只取前 2 个upload_url_list、model、style、titlelyrics 可选,优先于 prompt 作为歌词;未传 lyrics 时,若提供了 prompt 则将 prompt 作为歌词| 模型 | lyrics / prompt 限制 | style 限制 | title 限制 |
|---|---|---|---|
| V4(已废弃) | 3000字符 | 200字符 | 80字符 |
| V4_5 和 V4_5PLUS(已废弃) | 5000字符 | 1000字符 | 100字符 |
| V4_5ALL(已废弃) | 5000字符 | 1000字符 | 80字符 |
| V5和 V5_5(已废弃) | 5000字符 | 1000字符 | 100字符 |
| V6、V6_WILD 和 V6_MINI | 5000字符 | 1000字符 | 100字符 |
text(文本生成)、first(第一首完成)、complete(全部完成)upload_url_list 需传 2 个音频文件 URL,上游只取前 2 个| 参数 | 类型 | 描述 |
|---|---|---|
lyrics | string | 混音音频的歌词。可选。V6 最多 5000 字符。优先于 prompt 作为歌词。 |
prompt | string | 仅在未传入 lyrics 时作为歌词。可选。V6 最多 5000 字符。 |
vocal_gender | string | 人声性别偏好。m 男声,f 女声。根据实践,此参数只能加强概率,但不能保证一定遵循男女声的指令。 |
style_weight | number | 对风格的遵循强度。范围 0–1,保留两位小数。示例:0.61。 |
weirdness_constraint | number | 创意/离散程度。范围 0–1,保留两位小数。示例:0.72。 |
audio_weight | number | 音频要素权重。范围 0–1,保留两位小数。示例:0.65。 |
variety | integer | 生成结果的多样性。范围 0–4 的整数,默认 1。0 关,1 普通,2 高,3 额外,4 最大。 |
persona_id | string | 应用到生成音乐的 Persona ID 或 Voice ID。 |
persona_model | string | persona 模型,style_persona 或 voice_persona。默认 style_persona。 |
duration | number | 音频时长,单位为秒。范围 10–360,默认 20。仅对 |
curl --location 'https://api.kie.ai/api/v1/jobs/createTask' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "ai-music-api/mashup",
"callBackUrl": "https://example.com/callback",
"input": {
"upload_url_list": [
"https://example.com/audio1.mp3",
"https://example.com/audio2.mp3"
],
"model": "V4",
"prompt": "A calm and relaxing piano track with soft melodies",
"style": "Jazz",
"title": "Relaxing Piano",
"vocal_gender": "m",
"style_weight": 0.61,
"weirdness_constraint": 0.72,
"audio_weight": 0.65,
"duration": 20,
"lyrics": "[主歌]\n让旋律继续流淌\n走进一段柔和的过渡\n[副歌]\n钢琴起伏回旋",
"variety": 1,
"persona_id": "persona_123",
"persona_model": "style_persona"
}
}'{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}