style(最大 1000 字符)、title(最大 80 字符)、lyrics / prompt(最大 5000 字符)imageUrls。翻唱不支持简单模式参考图uploadUrl、instrumental、callBackUrl、modeluploadUrl)即可生成;lyrics(原 prompt)、title、style 非必传lyrics 优先于 prompt 作为歌词;未传 lyrics 时,若提供了 prompt 则将 prompt 作为歌词instrumental 为 true:生成纯音乐(无歌词),请勿传入 lyrics、prompt 或 vocalGenderuploadUrl 用于指定源音频文件。请确保上传的音频长度不超过 8 分钟lyrics / prompt、style 和 title 的字符长度限制,确保成功处理。text(文本生成完成)、first(第一首完成)、complete(全部完成)。uploadUrl 参数用于指定源音频文件;请提供有效的 URL。| 参数 | 类型 | 描述 |
|---|---|---|
lyrics | string | 翻唱音频的歌词。可选。V6 最多 5000 字符。优先于 prompt 作为歌词。 |
prompt | string | 仅在未传入 lyrics 时作为歌词。可选。V6 最多 5000 字符。 |
style | string | 音乐风格规范。可选。V6 最多 1000 字符。 |
title | string | 曲目标题。可选。最多 80 字符。 |
negativeTags | string | 需要在生成的音频中排除的音乐风格或特征。 |
vocalGender | string | 人声性别偏好。m 代表男声,f 代表女声。 |
styleWeight | number | 对风格的遵循强度。范围 0–1,保留两位小数。示例:0.65。 |
weirdnessConstraint | number | 创意/离散程度控制。范围 0–1,保留两位小数。示例:0.65。 |
audioWeight | number | 音频要素权重。范围 0–1,保留两位小数。示例:0.65。 |
variety | integer | 生成结果的多样性。范围 0–4 的整数,默认 1。0 关,1 普通,2 高,3 额外,4 最大。 |
personaId | string | 应用到生成音乐的 Persona ID 或 Voice ID。生成 personaId 请访问 生成 Persona。 |
duration | integer | 音频时长,单位为秒。范围 10–360,默认 20。仅对 |
curl --location 'https://api.kie.ai/api/v1/generate/upload-cover' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"uploadUrl": "https://storage.example.com/upload",
"prompt": "A calm and relaxing piano track with soft melodies",
"instrumental": true,
"model": "V4",
"callBackUrl": "https://api.example.com/callback",
"style": "Classical",
"title": "Peaceful Piano Meditation",
"negativeTags": "Heavy Metal, Upbeat Drums",
"vocalGender": "m",
"styleWeight": 0.65,
"weirdnessConstraint": 0.65,
"audioWeight": 0.65,
"personaId": "persona_123",
"personaModel": "style_persona",
"lyrics": "[主歌]\n让旋律继续流淌\n走进一段柔和的过渡\n[副歌]\n钢琴起伏回旋",
"variety": 1
}'{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}