# 延伸上传的音频

**这是什么**：把你自己上传的一段音频接着往后生成。

**什么时候用**：有一段自己的录音/伴奏，想让 AI 接着创作时用。

## 接口地址
- POST `/api/cqt/generator/suno` (task: `upload_extend`)
- GET `/api/cqt/info/suno?id={taskId}`

## 请求参数
| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| task | string | 是 | 固定填 upload_extend |
| model | string | 是 | 模型版本（推荐 v6） |
| audioUrl | string | 是 | 你上传音频的可下载 URL |
| continueAt | number | — | 从上传音频第几秒开始续接 |
| customMode | bool | — | 是否自定义模式：true 时 prompt 作精确歌词，false 时作风格描述 |
| prompt | string | — | 风格描述或歌词（随 customMode） |
| tags | string | — | 风格标签，如 Happy, Party |
| negativeTags | string/array | — | 要排除的风格标签 |
| title | string | — | 歌曲标题 |
| makeInstrumental | bool | — | 是否纯伴奏（无人声），默认 false |
| styleWeight | number(0~1) | — | 风格权重，越大越贴近 tags 风格 |
| audioWeight | number(0~1) | — | 原音频影响权重（用于基于音频的任务） |
| weirdnessConstraint | number(0~1) | — | 创意/怪异度，越大越大胆 |
| personaId | string | — | 音色/角色 ID（用声音角色演唱） |
| artistClipId | string | — | 风格参考片段 ID |

## 请求示例
```bash
curl -X POST https://api.novapi.ai/api/cqt/generator/suno \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "task": "upload_extend",
    "model": "v6",
    "customMode": false,
    "audioUrl": "https://cdn1.suno.ai/4f51f49d-8875-442d-9a66-81a7e66d55d6.mp3",
    "continueAt": 60,
    "makeInstrumental": false,
    "prompt": "Upbeat EDM about sunrise and new beginnings.",
    "tags": "Happy, Party",
    "negativeTags": "Hip-Hop/Rap",
    "title": "Roadtrip Sunrise2",
    "styleWeight": 0.65,
    "weirdnessConstraint": 0.65,
    "audioWeight": 0.65
  }'
# -> { "code":200, "data":"<taskId>" }
```

## 响应示例
```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": "6a52043628d141ff935630360126a59e",
    "taskType": "upload_extend",
    "status": "succeeded",
    "errorMsg": "",
    "param": {
      "task": "upload_extend",
      "model": "chirp-v45",
      "customMode": false,
      "audioUrl": "https://cdn1.suno.ai/4f51f49d-8875-442d-9a66-81a7e66d55d6.mp3",
      "continueAt": 60,
      "makeInstrumental": false,
      "prompt": "Upbeat EDM about sunrise and new beginnings.",
      "tags": "Happy, Party",
      "negativeTags": "Hip-Hop/Rap",
      "title": "Roadtrip Sunrise2",
      "styleWeight": 0.65,
      "weirdnessConstraint": 0.65,
      "audioWeight": 0.65
    },
    "result": [
      {
        "id": "7c060811-93e1-4a60-8b6f-a8d95664b87c",
        "title": "Roadtrip Sunrise2",
        "handle": "rositabadgercldrq",
        "status": "complete",
        "user_id": "8338d85e-0591-4277-a134-cc1080a107f5",
        "metadata": {
          "key": "E_major",
          "tags": "Happy, Party",
          "task": "upload_extend",
          "type": "gen",
          "prompt": "[Verse 1] Window full of gold Shoes on the floor …（完整歌词已省略）",
          "avg_bpm": 140.08,
          "max_bpm": 142.86,
          "min_bpm": 136.36,
          "duration": 140.64,
          "is_remix": true,
          "has_vocal": true,
          "continue_at": 60,
          "negative_tags": "Hip-Hop/Rap",
          "edited_clip_id": "a64de940-752d-4a58-8085-9d869792b581",
          "history": [
            { "id": "a64de940-752d-4a58-8085-9d869792b581", "type": "upload", "source": "ios", "continue_at": 60 }
          ],
          "control_sliders": { "audio_weight": 0.65, "style_weight": 0.65, "weirdness_constraint": 0.65 },
          "make_instrumental": false,
          "uses_latest_model": false,
          "can_publish_with_vocal": true,
          "gpt_description_prompt": "Upbeat EDM about sunrise and new beginnings."
        },
        "audio_url": "https://cdn1.suno.ai/7c060811-93e1-4a60-8b6f-a8d95664b87c.mp3",
        "image_url": "https://cdn2.suno.ai/image_7c060811-93e1-4a60-8b6f-a8d95664b87c.jpeg",
        "image_large_url": "https://cdn2.suno.ai/image_large_7c060811-93e1-4a60-8b6f-a8d95664b87c.jpeg",
        "video_url": "",
        "clip_roots": {
          "clips": [
            {
              "id": "a64de940-752d-4a58-8085-9d869792b581",
              "title": "4f51f49d-8875-442d-9a66-81a7e66d55d6",
              "image_url": "https://cdn2.suno.ai/image_a64de940-752d-4a58-8085-9d869792b581.jpeg",
              "user_handle": "rositabadgercldrq",
              "user_display_name": "rositabadgercldrq"
            }
          ],
          "clip_attribution_type": "remix"
        },
        "media_urls": [
          { "url": "https://d2lwuy8qc234o3.cloudfront.net/1/clip/7c060811-93e1-4a60-8b6f-a8d95664b87c.m4a", "delivery": "progressive", "content_type": "m4a-opus" },
          { "url": "https://cdn1.suno.ai/7c060811-93e1-4a60-8b6f-a8d95664b87c.mp3", "delivery": "progressive", "content_type": "mp3" }
        ],
        "model_name": "chirp-auk",
        "batch_index": 0,
        "created_at": "2026-07-08T06:49:07.242Z",
        "major_model_version": "v4.5"
      },
      {
        "id": "f695c860-a09c-435d-838f-d0b571e38558",
        "title": "Roadtrip Sunrise2",
        "status": "complete",
        "metadata": {
          "key": "E_major",
          "task": "upload_extend",
          "duration": 144.96,
          "avg_bpm": 140.06,
          "is_remix": true,
          "has_vocal": true,
          "continue_at": 60,
          "gpt_description_prompt": "Upbeat EDM about sunrise and new beginnings."
        },
        "audio_url": "https://cdn1.suno.ai/f695c860-a09c-435d-838f-d0b571e38558.mp3",
        "image_url": "https://cdn2.suno.ai/image_f695c860-a09c-435d-838f-d0b571e38558.jpeg",
        "batch_index": 1,
        "major_model_version": "v4.5"
      }
    ],
    "createTime": "2026-07-08 14:48:24",
    "completeTime": "2026-07-08 14:51:01"
  }
}
```

## 响应字段说明
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| code | number | 状态码，200 表示成功 |
| msg | string | 提示信息 |
| data.id | string | 任务 ID（= 提交时拿到的 taskId，用于轮询查询） |
| data.taskType | string | 任务类型，与提交的 task 一致 |
| data.status | string | 任务状态：pending 处理中 / succeeded 成功 / failed 失败 |
| data.errorMsg | string | 失败原因，成功时为空 |
| data.param | object | 原样回显你提交的请求参数 |
| data.result | array | 生成结果，一次返回 2 条候选片段 |
| data.result[].id | string | 生成片段的 clipId，可继续用于再次 extend / cover 等 |
| data.result[].audio_url | string | 音频文件地址（mp3） |
| data.result[].video_url | string | 视频文件地址（mp4），有时为空需稍后再查 |
| data.result[].image_url | string | 封面图地址（image_large_url 为大图） |
| data.result[].title | string | 歌曲标题 |
| data.result[].status | string | 片段状态，complete 表示可下载 |
| data.result[].metadata.duration | number | 音频总时长（秒） |
| data.result[].metadata.tags | string | 风格标签 |
| data.result[].metadata.key | string | 调性，如 E_major |
| data.result[].metadata.avg_bpm | number | 平均速度 BPM（另有 max_bpm/min_bpm） |
| data.result[].metadata.has_vocal | bool | 是否含人声 |
| data.result[].metadata.continue_at | number | 从上传音频第几秒开始续接 |
| data.result[].metadata.history | array | 溯源链：type=upload 表示续接自你上传的音频 |
| data.result[].metadata.negative_tags | string | 排除的风格标签（回显 negativeTags） |
| data.result[].metadata.gpt_description_prompt | string | 你输入的风格描述（回显 prompt） |
| data.result[].metadata.is_remix | bool | 是否二次创作，upload_extend 恒为 true |
| data.result[].clip_roots | object | 源片段（父曲）信息：标题 / 封面 / 作者 |
| data.result[].media_urls | array | 多格式音频地址（m4a-opus / mp3） |
| data.result[].batch_index | number | 候选序号（0、1） |
| data.result[].major_model_version | string | 生成所用模型版本，如 v4.5 / v5.5 |
| data.createTime / completeTime | string | 任务提交时间 / 完成时间 |
| 其它字段 | — | action_config / model_badges / secondary_badges / ownership / avatar_image_url 等为 Suno 前端展示用，可忽略 |

## OpenAI 协议写法
同一个 task 也可用 `POST /v1/audio/generations` 调用（body 加 `task: "upload_extend"`，model 写成 suno-v6 形式），用 `GET /v1/audio/generations/{id}` 轮询，非音频类结果在 `result` 字段。

```bash
curl -X POST https://api.novapi.ai/v1/audio/generations \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "suno-v6",
  "task": "upload_extend",
  "customMode": false,
  "audioUrl": "https://cdn1.suno.ai/4f51f49d-8875-442d-9a66-81a7e66d55d6.mp3",
  "continueAt": 60,
  "makeInstrumental": false,
  "prompt": "Upbeat EDM about sunrise and new beginnings.",
  "tags": "Happy, Party",
  "negativeTags": "Hip-Hop/Rap",
  "title": "Roadtrip Sunrise2",
  "styleWeight": 0.65,
  "weirdnessConstraint": 0.65,
  "audioWeight": 0.65
}'
# -> { "id":"audio_<taskId>", "object":"audio.generation", "status":"queued", ... }
# poll: GET https://api.novapi.ai/v1/audio/generations/audio_<taskId>
```
