---
title: "Replace Music Section"
method: POST
path: "/api/v1/generate/replace-section"
tags: ["Music Generation"]
---

# Replace Music Section

`POST /api/v1/generate/replace-section`

Replace a specific time segment within existing music.

This interface can replace specific time segments in already generated music. It requires providing the original music's task ID and the time range to be replaced. The replaced audio will naturally blend with the original music.

### Time Range Instructions
- `infillStartS` must be less than `infillEndS`.
- Time values are precise to 2 decimal places, e.g., `10.50` seconds.
- The replacement time range must be between **6 and 60 seconds**.
- Replacement duration should not exceed **50%** of the original music's total duration.

### Developer Notes
- Replacement segments will be regenerated based on the provided `prompt` and `tags`.
- Generated replacement segments will automatically blend with the original music's preceding and following parts.
- Generated files will be retained for **14 days**.
- Query task status using the same interface as generating music: [Get Music Details](/suno-api/get-music-generation-details).

## Request body

- union
  - object
    - `taskId` string, required — Original task ID (parent task), used to identify the source music for section replacement.
    - `audioId` string, required — Unique identifier of the audio track to replace. This ID is returned in the callback data after music generation completes.
    - `prompt` string, required — Replaced lyrics
    - `tags` string, required — Music style tags, such as jazz, electronic, etc.
    - `title` string, required — Music title
    - `negativeTags` string — Excluded music styles, used to avoid specific style elements in the replacement segment
    - `infillStartS` number, required — Start time point for replacement (seconds), 2 decimal places. Must be less than infillEndS. The time interval (infillEndS - infillStartS) must be between 6 and 60 seconds.
    - `infillEndS` number, required — End time point for replacement (seconds), 2 decimal places. Must be greater than infillStartS. The time interval (infillEndS - infillStartS) must be between 6 and 60 seconds.
    - `fullLyrics` string, required — Complete lyrics after modification, combining both modified and unmodified lyrics. This parameter contains the full lyrics text that will be used for the entire song after the section replacement.
    - `callBackUrl` string, uri — Callback URL for task completion. The system will send a POST request to this URL when replacement is complete, containing task status and results. - Your callback endpoint should be able to accept POST requests containing JSON payloads with replacement results - For detailed callback format and implementation guide, see [Replace Music Section Callbacks](/suno-api/replace-section-callbacks) - Alternatively, you can use the [Get Music Generation Details](/suno-api/get-music-generation-details) endpoint to poll task status
  - object
    - `uploadUrl` string, uri, required — URL of the custom audio uploaded by the user.
    - `model` 'V4' | 'V4_5' | 'V4_5PLUS' | 'V4_5ALL' | 'V5' | 'V5_5', required — AI model version used for generation. - Available options: - **`V5_5`**: A tailor-made exclusive model that fits your unique taste. - **`V5`**: Better musical expressiveness with faster generation speed. - **`V4_5PLUS`**: V4.5+ with richer timbre, new creative methods, up to 8 minutes. - **`V4_5`**: V4.5 with smarter prompts, faster generation speed, up to 8 minutes. - **`V4_5ALL`**: V4.5ALL with smarter prompts, faster generation speed, up to 8 minutes. - **`V4`**: V4 with improved vocal quality, up to 4 minutes.
    - `prompt` string, required — Replaced lyrics
    - `tags` string, required — Music style tags, such as jazz, electronic, etc.
    - `title` string, required — Music title
    - `negativeTags` string — Excluded music styles, used to avoid specific style elements in the replacement segment
    - `infillStartS` number, required — Start time point for replacement (seconds), 2 decimal places. Must be less than infillEndS. The time interval (infillEndS - infillStartS) must be between 6 and 60 seconds.
    - `infillEndS` number, required — End time point for replacement (seconds), 2 decimal places. Must be greater than infillStartS. The time interval (infillEndS - infillStartS) must be between 6 and 60 seconds.
    - `fullLyrics` string, required — Complete lyrics after modification, combining both modified and unmodified lyrics. This parameter contains the full lyrics text that will be used for the entire song after the section replacement.
    - `callBackUrl` string, uri — Callback URL for task completion. The system will send a POST request to this URL when replacement is complete, containing task status and results. - Your callback endpoint should be able to accept POST requests containing JSON payloads with replacement results - For detailed callback format and implementation guide, see [Replace Music Section Callbacks](/suno-api/replace-section-callbacks) - Alternatively, you can use the [Get Music Generation Details](/suno-api/get-music-generation-details) endpoint to poll task status

## Response `200`

Request successful

- object
  - `code` 200 | 401 | 402 | 404 | 409 | 422 | 429 | 451 | 455 | 500 — Response status code - **200**: Success - Request processed successfully - **401**: Unauthorized - Authentication credentials missing or invalid - **402**: Insufficient credits - Account does not have enough credits to perform this operation - **404**: Not found - Requested resource or endpoint does not exist - **409**: Conflict - WAV record already exists - **422**: Validation error - Request parameters failed validation checks - **429**: Rate limit exceeded - Exceeded request limit for this resource - **451**: Unauthorized - Failed to retrieve image. Please verify any access restrictions set by you or your service provider. - **455**: Service unavailable - System is currently undergoing maintenance - **500**: Server error - Unexpected error occurred while processing request
  - `msg` string — Error message when code != 200
  - `data` object
    - `taskId` string — Task ID for tracking task status. You can use this ID to query task details and results through the [Get Music Generation Details](/suno-api/get-music-generation-details) interface.

## Other responses

- `500` — Request failed

---

[API](https://skmtc.dev/sunoapi/apis/file-upload-api.md) · [All operations](https://skmtc.dev/sunoapi/apis/file-upload-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sunoapi/file-upload-api/revisions/22d45ee33a4a/schema)
