# Merge Clips

**What**：Concatenate/merge multiple audio clips into one.

**When**：Use to combine separately-generated parts into a full song.

## Endpoints
- POST `/api/cqt/generator/suno` (task: `replace_merge`)
- GET `/api/cqt/info/suno?id={taskId}`

## Request params
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| task | string | Yes | Fixed value: replace_merge |
| clipId | string | Yes | Clip ID to merge |
| editSessionId | string | Yes | Edit session ID (from a replace_section task) |

## Request example
```bash
curl -X POST https://api.novapi.ai/api/cqt/generator/suno \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "task": "replace_merge",
    "clipId": "214f6b75-81c9-46a4-9e68-2f8e496ce5c0",
    "editSessionId": "2d2991ed-401e-4926-9e7e-9963108e850c"
  }'
# -> { "code":200, "data":"<taskId>" }
```

## Response example
```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": "a99ab659a9104c118f2e608a6131d8dc",
    "taskType": "replace_merge",
    "status": "succeeded",
    "errorMsg": "",
    "param": {
      "task": "replace_merge",
      "clipId": "214f6b75-81c9-46a4-9e68-2f8e496ce5c0",
      "editSessionId": "2d2991ed-401e-4926-9e7e-9963108e850c"
    },
    "result": {
      "clips": [
        {
          "id": "836f89ad-6812-42fe-9116-73e86fcfaf4e",
          "title": "两只老虎",
          "handle": "azqrxeykoa",
          "status": "complete",
          "user_id": "ab75d2ee-a55b-405d-8606-d51e8720a4fe",
          "metadata": {
            "tags": "Happy",
            "type": "concat_infilling",
            "prompt": "空",
            "duration": 99.88,
            "is_remix": false,
            "can_remix": true,
            "edit_session_id": "2d2991ed-401e-4926-9e7e-9963108e850c",
            "concat_history": [
              {
                "id": "2d2991ed-401e-4926-9e7e-9963108e850c",
                "type": "gen",
                "infill": true,
                "infill_start_s": 6.36,
                "infill_end_s": 30.8,
                "infill_dur_s": 24.44,
                "infill_lyrics": "聪明老虎 聪明老虎跑得慢 …（完整歌词已省略）",
                "infill_context_start_s": 0,
                "infill_context_end_s": 99.92
              },
              { "id": "214f6b75-81c9-46a4-9e68-2f8e496ce5c0" }
            ],
            "can_publish_with_vocal": true
          },
          "audio_url": "https://cdn1.suno.ai/836f89ad-6812-42fe-9116-73e86fcfaf4e.mp3",
          "image_url": "https://cdn2.suno.ai/image_214f6b75-81c9-46a4-9e68-2f8e496ce5c0.jpeg",
          "image_large_url": "https://cdn2.suno.ai/image_large_214f6b75-81c9-46a4-9e68-2f8e496ce5c0.jpeg",
          "video_url": "",
          "clip_roots": {
            "clips": [
              { "user_handle": "playfulsubtlety0358", "user_display_name": "PlayfulSubtlety0358" }
            ],
            "clip_attribution_type": "remix"
          },
          "media_urls": [
            { "url": "https://d2lwuy8qc234o3.cloudfront.net/1/clip/836f89ad-6812-42fe-9116-73e86fcfaf4e.m4a", "delivery": "progressive", "content_type": "m4a-opus" },
            { "url": "https://cdn1.suno.ai/836f89ad-6812-42fe-9116-73e86fcfaf4e.mp3", "delivery": "progressive", "content_type": "mp3" }
          ],
          "model_name": "chirp-auk",
          "batch_index": 0,
          "created_at": "2026-07-08T07:29:29.831Z",
          "major_model_version": "v4.5"
        }
      ]
    },
    "createTime": "2026-07-08 15:29:24",
    "completeTime": "2026-07-08 15:29:50"
  }
}
```

## Response fields
| Field | Type | Description |
| --- | --- | --- |
| code | number | Status code; 200 = success |
| msg | string | Message |
| data.id | string | Task ID (the taskId returned on submit) |
| data.taskType | string | Task type; always "replace_merge" |
| data.status | string | Status: pending / succeeded / failed |
| data.param | object | Echo of the request params you submitted |
| data.result | object | ⚠ An object (NOT an array); the merged result lives under result.clips |
| data.result.clips | array | The merged clip(s); usually one full song |
| data.result.clips[].id | string | The merged clip’s clipId |
| data.result.clips[].audio_url | string | Full-song audio URL (mp3) |
| data.result.clips[].image_url | string | Cover image URL (image_large_url is the large one) |
| data.result.clips[].status | string | Clip status; "complete" = ready to download |
| data.result.clips[].metadata.type | string | Merge type: concat_infilling (concatenated inpainted sections) |
| data.result.clips[].metadata.duration | number | Total duration after merge (seconds) |
| data.result.clips[].metadata.edit_session_id | string | Edit session ID (= the editSessionId you passed) |
| data.result.clips[].metadata.concat_history | array | Concatenation lineage: which clips / inpainted sections were merged |
| data.result.clips[].media_urls | array | Multi-format audio URLs (m4a-opus / mp3) |
| data.result.clips[].major_model_version | string | Model version used, e.g. v4.5 |
| data.createTime / completeTime | string | Task submit time / completion time |
| 其它字段 | — | action_config / model_badges / secondary_badges / avatar_image_url, etc. are for Suno UI and can be ignored |

## OpenAI-style call
This task is also available via `POST /v1/audio/generations` (add `task: "replace_merge"` to the body, write model as suno-v6); poll `GET /v1/audio/generations/{id}`, non-audio results are in `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",
  "task": "replace_merge",
  "clipId": "214f6b75-81c9-46a4-9e68-2f8e496ce5c0",
  "editSessionId": "2d2991ed-401e-4926-9e7e-9963108e850c"
}'
# -> { "id":"audio_<taskId>", "object":"audio.generation", "status":"queued", ... }
# poll: GET https://api.novapi.ai/v1/audio/generations/audio_<taskId>
```
