# Replace Section

**What**：Redo only one part of a song (e.g. the second verse), keeping the rest.

**When**：Use when most of a song is fine but one section needs redoing.

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

## Request params
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| task | string | Yes | Fixed value: replace_section |
| taskId | string | Yes | Task ID the source song belongs to |
| clipId | string | Yes | Source song clip ID |
| rangeStartS | number | Yes | Start second of the section to replace |
| rangeEndS | number | Yes | End second of the section to replace |
| infillLyrics | string | Yes | New lyrics for the replaced section |
| tags | string | — | Style tags |
| title | string | — | Song title |
| infillType | enum | — | smart (default) / classic / fixed |

## 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_section",
    "taskId": "d649231618784ee4b9cfa059ac50be5e",
    "clipId": "eb1c6c96-a102-4bbb-82c2-87c3b126a44e",
    "tags": "Happy",
    "title": "两只老虎(聪明)",
    "infillLyrics": "两只老虎 两只老虎跑得快 一只没有耳朵 一只没有尾巴 真奇怪",
    "rangeStartS": 7.56,
    "rangeEndS": 15.98
  }'
# -> { "code":200, "data":"<taskId>" }
```

## Response example
```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": "c8d1e607b5a84c41889e23981ffd6305",
    "taskType": "replace_section",
    "status": "succeeded",
    "errorMsg": "",
    "param": {
      "task": "replace_section",
      "taskId": "d649231618784ee4b9cfa059ac50be5e",
      "clipId": "eb1c6c96-a102-4bbb-82c2-87c3b126a44e",
      "tags": "Happy",
      "title": "两只老虎(聪明)",
      "infillLyrics": "两只老虎 两只老虎跑得快 …（完整歌词已省略）",
      "rangeStartS": 7.56,
      "rangeEndS": 15.98
    },
    "result": [
      {
        "id": "ad924885-4655-4ca4-ab36-e67c12e3f7e5",
        "title": "两只老虎(聪明)",
        "handle": "rositabadgercldrq",
        "status": "complete",
        "user_id": "8338d85e-0591-4277-a134-cc1080a107f5",
        "metadata": {
          "tags": "Happy",
          "task": "infill",
          "type": "gen",
          "infill": true,
          "prompt": "两只老虎 两只老虎跑得快 …（完整歌词已省略）",
          "duration": 14.44,
          "is_remix": true,
          "infill_lyrics": "两只老虎 两只老虎跑得快 …（完整歌词已省略）",
          "edited_clip_id": "eb1c6c96-a102-4bbb-82c2-87c3b126a44e",
          "lyrics_updated": false,
          "history": [
            {
              "id": "eb1c6c96-a102-4bbb-82c2-87c3b126a44e",
              "type": "gen",
              "infill": true,
              "infill_start_s": 7.56,
              "infill_end_s": 15.98,
              "infill_dur_s": 8.42,
              "infill_context_start_s": 0,
              "infill_context_end_s": 61,
              "include_history_s": 2,
              "include_future_s": 2
            }
          ]
        },
        "audio_url": "https://cdn1.suno.ai/ad924885-4655-4ca4-ab36-e67c12e3f7e5.mp3",
        "image_url": "https://cdn2.suno.ai/image_ad924885-4655-4ca4-ab36-e67c12e3f7e5.jpeg",
        "image_large_url": "https://cdn2.suno.ai/image_large_ad924885-4655-4ca4-ab36-e67c12e3f7e5.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/ad924885-4655-4ca4-ab36-e67c12e3f7e5.m4a", "delivery": "progressive", "content_type": "m4a-opus" },
          { "url": "https://cdn1.suno.ai/ad924885-4655-4ca4-ab36-e67c12e3f7e5.mp3", "delivery": "progressive", "content_type": "mp3" }
        ],
        "model_name": "chirp-crow",
        "batch_index": 0,
        "created_at": "2026-07-08T07:27:11.972Z",
        "major_model_version": "v5"
      },
      {
        "id": "764ee8ad-5c6f-4d99-8b78-c6054712094d",
        "title": "两只老虎(聪明)",
        "status": "complete",
        "metadata": {
          "task": "infill",
          "infill": true,
          "duration": 17.52,
          "is_remix": true,
          "edited_clip_id": "eb1c6c96-a102-4bbb-82c2-87c3b126a44e"
        },
        "audio_url": "https://cdn1.suno.ai/764ee8ad-5c6f-4d99-8b78-c6054712094d.mp3",
        "image_url": "https://cdn2.suno.ai/image_764ee8ad-5c6f-4d99-8b78-c6054712094d.jpeg",
        "batch_index": 1,
        "major_model_version": "v5"
      }
    ],
    "createTime": "2026-07-08 15:27:09",
    "completeTime": "2026-07-08 15:27:44"
  }
}
```

## Response fields
| Field | Type | Description |
| --- | --- | --- |
| code | number | Status code; 200 = success |
| msg | string | Message |
| data.id | string | Task ID (the taskId returned on submit; used to poll) |
| data.taskType | string | Task type; matches the submitted task |
| data.status | string | Status: pending / succeeded / failed |
| data.errorMsg | string | Failure reason; empty on success |
| data.param | object | Echo of the request params you submitted |
| data.result | array | Results; returns 2 candidate clips |
| data.result[].id | string | The generated clipId; reusable for further extend / cover, etc. |
| data.result[].audio_url | string | Audio file URL (mp3) |
| data.result[].video_url | string | Video file URL (mp4); may be empty, re-query later |
| data.result[].image_url | string | Cover image URL (image_large_url is the large one) |
| data.result[].title | string | Song title |
| data.result[].status | string | Clip status; "complete" = ready to download |
| data.result[].metadata.duration | number | Total audio duration (seconds) |
| data.result[].metadata.tags | string | Style tags |
| data.result[].metadata.task | string | For replace_section, the clip metadata.task shows "infill" (section inpaint) |
| data.result[].metadata.infill | bool | Whether it is a section inpaint; always true here |
| data.result[].metadata.infill_lyrics | string | New lyrics for the replaced section (echo of infillLyrics) |
| data.result[].metadata.edited_clip_id | string | Edited source clip ID (= the clipId you passed) |
| data.result[].metadata.history[].infill_start_s / infill_end_s / infill_dur_s | number | Start/end second and duration of the replaced section |
| data.result[].metadata.history[].infill_context_start_s / infill_context_end_s | number | Context range (seconds) referenced during generation |
| data.result[].metadata.is_remix | bool | Whether it is a remix; always true for replace_section |
| data.result[].clip_roots | object | Source (parent) clip info: title / cover / author |
| data.result[].media_urls | array | Multi-format audio URLs (m4a-opus / mp3) |
| data.result[].batch_index | number | Candidate index (0, 1) |
| data.result[].major_model_version | string | Model version used, e.g. v4.5 / v5.5 |
| data.createTime / completeTime | string | Task submit time / completion time |
| 其它字段 | — | action_config / model_badges / secondary_badges / ownership / 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_section"` 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_section",
  "taskId": "d649231618784ee4b9cfa059ac50be5e",
  "clipId": "eb1c6c96-a102-4bbb-82c2-87c3b126a44e",
  "tags": "Happy",
  "title": "两只老虎(聪明)",
  "infillLyrics": "两只老虎 两只老虎跑得快 一只没有耳朵 一只没有尾巴 真奇怪",
  "rangeStartS": 7.56,
  "rangeEndS": 15.98
}'
# -> { "id":"audio_<taskId>", "object":"audio.generation", "status":"queued", ... }
# poll: GET https://api.novapi.ai/v1/audio/generations/audio_<taskId>
```
