# Merge music

> Suno v1 has its own task system, different from Suno v2: a submit returns a numeric taskId and results come from the v1 query endpoints; task IDs and result formats are not interchangeable between the two. For the OpenAI-style entry use /v1/audio/generations (model suno_v1).

**What**：Merge a replaced (Replace Section) or extended segment back into one complete song.

**When**：Replace-section results come as segments; use this to get the finished full song. When merging a Replace Section result, is_infill must be true and edit_session_id is required.

## Endpoints
- Submit task: POST `/api/cqt/suno/v1/mergeMusicTask`
- Query the result (with the returned taskId): GET `/api/cqt/suno/v1/sunoInfo?taskId={taskId}`

> After submitting, poll with the taskId — every 5–10 seconds is enough, no need to hit it every second.

## Request params
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| clip_id | string | Yes | ID of the clip to merge. |
| is_infill | boolean | Yes | Whether this is an infill (must be true when merging a Replace Section result). |
| project_id | string | — | Project ID. |
| edit_session_id | string | — | Edit session ID (required when is_infill is true). |

## Request example
```bash
curl -X POST https://api.novapi.ai/api/cqt/suno/v1/mergeMusicTask \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{"clip_id":"<clipId>","is_infill":true,"edit_session_id":"<EDIT_SESSION_ID>"}'
# -> { "code":200, "msg":"success", "data":{ "taskId":1234567890 } }
```

## Response example
```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": 1234567890
  }
}
```

## Response fields
| Field | Type | Description |
| --- | --- | --- |
| code | number | Business code: 200 = success; see the error notes for the rest. The HTTP status is normally 200. |
| msg | string | Message: success on success, the reason on failure. |
| data.taskId | number | Task ID (a number). Use it with the query endpoint to fetch the result. |
