场景五: 续写自定义音频
本场景演示把自建音频接进 Suno 续写的做法。
- 提交:POST https://api.allyang.cn/suno/generate
- 查询结果:GET https://api.allyang.cn/suno/feed/{clipId1},{clipId2}
A.上传音乐
先调用上传接口取回 clip_id,本示例记为 abcd-1234-1234-1234-abd。
B.扩展音乐.带版本信息
mv 可取 chirp-v4、chirp-auk、chirp-bluejay;task 固定为 upload_extend。
json
{
"prompt": "<歌词>",
"tags": "",
"negative_tags": "",
"mv": "chirp-v4",
"title": "<标题>",
"continue_clip_id": "abcd-1234-1234-1234-abd",
"continue_at": 10,
"task": "upload_extend"
}
C.扩展音乐.将弃用
注意:此方式的 mv 为 chirp-v3-5-upload 或 chirp-v4-upload,即将弃用。
json
{
"prompt": "<歌词>",
"tags": "heavy metal",
"mv": "chirp-v3-5-upload",
"title": "<标题>",
"continue_clip_id": "abcd-1234-1234-1234-abd",
"continue_at": 30.792
}
D.拼接完整音乐
注意:is_infill 为 false。
取替换完成的后一首作品 id,通过查询接口获取状态。
计费:按一首歌计(具体单价待补,以控制台「日志与用量」为准)。
post https://api.allyang.cn/suno/generate/concat
shell
curl --request POST \
--url https://api.allyang.cn/suno/generate/concat \
--header 'Authorization: Bearer <令牌>' \
--header 'Content-Type: application/json' \
--data '{
"clip_id": "newid-1234-1234-1234-one",
"is_infill": false
}'
请求体
json
{
"clip_id": "newid-1234-1234-1234-one",
"is_infill": false
}