# 加人声

**这是什么**：给指定的一段伴奏补上人声演唱。

**什么时候用**：有一段纯伴奏、想加上唱歌时用。

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

## 请求参数
| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| task | string | 是 | 固定填 add_vocals |
| model | string | 是 | 模型版本（推荐 v6） |
| clipId | string | 是 | 源片段 ID |
| rangeStartS | number | 是 | 处理段落开始秒数 |
| rangeEndS | number | 是 | 处理段落结束秒数 |

## 请求示例
```bash
curl -X POST https://api.novapi.ai/api/cqt/generator/suno \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{ "task":"add_vocals", "model":"v6", "clipId":"5751729f-66f7-493c-bf22-4c4cda6cb0bd", "rangeStartS":0, "rangeEndS":30 }'
# -> { "code":200, "data":"<taskId>" }
```

## 响应示例
```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": "f7c0c894eb1442b39892bb12cb032eb5",
    "taskType": "add_vocals",
    "status": "succeeded",
    "errorMsg": "",
    "param": {
      "task": "add_vocals",
      "model": "chirp-v55",
      "clipId": "5751729f-66f7-493c-bf22-4c4cda6cb0bd",
      "rangeStartS": 0,
      "rangeEndS": 30
    },
    "result": [
      {
        "id": "e625cfb7-5b01-4333-b2f3-65ff8ecac8da",
        "title": "",
        "handle": "roselinhobbui3xs",
        "status": "complete",
        "user_id": "643d21e5-da6b-421c-ad4c-fa10b8bfdc90",
        "metadata": {
          "tags": "",
          "task": "overpainting",
          "type": "gen",
          "prompt": "",
          "avg_bpm": 115.23,
          "max_bpm": 136.36,
          "min_bpm": 66.67,
          "duration": 240,
          "is_remix": true,
          "make_instrumental": false,
          "uses_latest_model": true,
          "overpainting_clip_id": "5751729f-66f7-493c-bf22-4c4cda6cb0bd"
        },
        "audio_url": "https://cdn1.suno.ai/e625cfb7-5b01-4333-b2f3-65ff8ecac8da.mp3",
        "image_url": "https://cdn2.suno.ai/image_e625cfb7-5b01-4333-b2f3-65ff8ecac8da.jpeg",
        "image_large_url": "https://cdn2.suno.ai/image_large_e625cfb7-5b01-4333-b2f3-65ff8ecac8da.jpeg",
        "video_url": "",
        "clip_roots": {
          "clips": [
            {
              "id": "5751729f-66f7-493c-bf22-4c4cda6cb0bd",
              "title": "Emanuel filho amado",
              "image_url": "https://cdn2.suno.ai/image_5751729f-66f7-493c-bf22-4c4cda6cb0bd.jpeg",
              "user_handle": "roselinhobbui3xs",
              "user_display_name": "roselinhobbui3xs"
            }
          ],
          "clip_attribution_type": "remix"
        },
        "media_urls": [
          { "url": "https://d2lwuy8qc234o3.cloudfront.net/1/clip/e625cfb7-5b01-4333-b2f3-65ff8ecac8da.m4a", "delivery": "progressive", "content_type": "m4a-opus" },
          { "url": "https://cdn1.suno.ai/e625cfb7-5b01-4333-b2f3-65ff8ecac8da.mp3", "delivery": "progressive", "content_type": "mp3" }
        ],
        "model_name": "chirp-fenix",
        "batch_index": 0,
        "created_at": "2026-07-09T01:34:15.890Z",
        "major_model_version": "v5.5"
      },
      {
        "id": "854277e7-b41b-4ff0-8cf8-b9887c5b05f8",
        "title": "",
        "status": "complete",
        "metadata": {
          "task": "overpainting",
          "type": "gen",
          "avg_bpm": 132.13,
          "duration": 186.84,
          "is_remix": true,
          "overpainting_clip_id": "5751729f-66f7-493c-bf22-4c4cda6cb0bd"
        },
        "audio_url": "https://cdn1.suno.ai/854277e7-b41b-4ff0-8cf8-b9887c5b05f8.mp3",
        "image_url": "https://cdn2.suno.ai/image_854277e7-b41b-4ff0-8cf8-b9887c5b05f8.jpeg",
        "batch_index": 1,
        "major_model_version": "v5.5"
      }
    ],
    "createTime": "2026-07-09 09:34:10",
    "completeTime": "2026-07-09 09:37:20"
  }
}
```

## 响应字段说明
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| 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.task | string | add_vocals 的片段 metadata.task 显示为 overpainting（底层叠绘） |
| data.result[].metadata.overpainting_clip_id | string | 被补人声的源片段 ID（= 你传的 clipId） |
| data.result[].metadata.avg_bpm | number | 平均速度 BPM（另有 max_bpm/min_bpm） |
| data.result[].metadata.is_remix | bool | 是否二次创作，add_vocals 恒为 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: "add_vocals"`，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": "add_vocals",
  "clipId": "5751729f-66f7-493c-bf22-4c4cda6cb0bd",
  "rangeStartS": 0,
  "rangeEndS": 30
}'
# -> { "id":"audio_<taskId>", "object":"audio.generation", "status":"queued", ... }
# poll: GET https://api.novapi.ai/v1/audio/generations/audio_<taskId>
```
