POST
/v2/extend扩展音乐 API
通过在末尾添加新内容来扩展现有音乐曲目。
POST
https://udioapi.pro/api/v2/extendtips
两种模式:继承原始参数或使用自定义参数。
使用Feed API并返回workId来检查进度。
requestHeaders
| name | required | description |
|---|---|---|
Authorization | yes | 用于身份验证的承载令牌 |
Content-Type | yes | application/json |
requestBody
请求体支持继承模式或自定义模式
继承模式
使用原始轨道参数进行扩展
noAdditionalParams
自定义模式
使用自定义参数扩展
| paramName | paramType | required | description | example |
|---|---|---|---|---|
prompt | string | yes | 新歌词或描述 | Change the music style to be calm and lyrical. |
style | string | no | 音乐风格 | lyrical |
title | string | no | 曲目标题 | lyrical song |
extensionStartTime | number | no | 延长的开始时间(以秒为单位) | 150 |
tags | string | no | 附加标签 | war |
commonParams
| paramName | paramType | required | description | example |
|---|---|---|---|---|
origin_task_id | string | yes | 原创音乐生成的任务 ID | gen20e094aeaadfe494ea33a5c80ee596083bksv |
extend_audio_index | number | yes | 0 表示第一个音频,1 表示第二个音频 | 0 |
custom_mode | boolean | no | false 表示继承模式,true 表示自定义模式 | false |
callback_url | string | no | 用于实时结果的可选 Webhook URL | https://your-domain.com/webhook |
responses
json
{
"code": 200,
"message": "success",
"workId": "ext2e31202d4f629447fa75f603ae2470565bksv"
}codeExamples
curl
curl -X POST "https://udioapi.pro/api/v2/extend" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin_task_id": "gen20e094aeaadfe494ea33a5c80ee596083bksv",
"extend_audio_index": 0,
"custom_mode": false
}'