{
"taskId": "2fac****9f72",
"audioId": "e231****-****-****-****-****8cadc7dc",
"prompt": "A calm and relaxing piano track.",
"tags": "Jazz",
"title": "Relaxing Piano",
"negativeTags": "Rock",
"infillStartS": 10.5,
"infillEndS": 20.75,
"fullLyrics": "[Verse 1]\nOriginal lyrics here\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics",
"callBackUrl": "https://example.com/callback"
}
{
"uploadUrl": "https://example.com/audio.mp3",
"model": "V6",
"prompt": "A calm and relaxing piano track.",
"tags": "Jazz",
"title": "Relaxing Piano",
"negativeTags": "Rock",
"infillStartS": 10.5,
"infillEndS": 20.75,
"fullLyrics": "[Verse 1]\nOriginal lyrics here\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics",
"callBackUrl": "https://example.com/callback"
}
{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}Replace Music Section
Replace a specific time segment within existing music.
{
"taskId": "2fac****9f72",
"audioId": "e231****-****-****-****-****8cadc7dc",
"prompt": "A calm and relaxing piano track.",
"tags": "Jazz",
"title": "Relaxing Piano",
"negativeTags": "Rock",
"infillStartS": 10.5,
"infillEndS": 20.75,
"fullLyrics": "[Verse 1]\nOriginal lyrics here\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics",
"callBackUrl": "https://example.com/callback"
}
{
"uploadUrl": "https://example.com/audio.mp3",
"model": "V6",
"prompt": "A calm and relaxing piano track.",
"tags": "Jazz",
"title": "Relaxing Piano",
"negativeTags": "Rock",
"infillStartS": 10.5,
"infillEndS": 20.75,
"fullLyrics": "[Verse 1]\nOriginal lyrics here\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics",
"callBackUrl": "https://example.com/callback"
}
{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}Model Versions
- Current models:
V6(default),V6_WILD,V6_MINI - Deprecated models:
V5_5,V5,V4_5PLUS,V4_5ALL,V4_5,V4 - Deprecated values remain available only for backward compatibility. New integrations should use a V6-series model.
Parameter Usage Guide
This endpoint supports two modes for specifying the source audio: Mode 1: Replace section using existing audiotaskIdandaudioIdare requireduploadUrlandmodelmust NOT be provided
uploadUrlandmodelare requiredtaskIdandaudioIdmust NOT be provided
Common Required Parameters
- prompt (string, required): Lyrics for the replaced segment. If
lyricsis also provided,lyricstakes priority for the replaced segment. - tags (string, required): Music style tags, such as jazz, electronic, etc.
- title (string, required): Music title
- infillStartS (number, required): Start time point for replacement (seconds), 2 decimal places. Must be less than infillEndS. The time interval (infillEndS - infillStartS) must be at least 10 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 at least 10 seconds.
- fullLyrics (string, required): Complete lyrics of the whole song after modification, combining both modified and unmodified lyrics. Distinct from
lyrics/prompt, which apply only to the replaced segment.
Optional Parameters
- lyrics (string): Lyrics for the replaced segment. Optional. V6 series maximum 5000 characters. Takes priority over
promptfor the replaced segment. Distinct fromfullLyrics, which is the complete song lyrics. - negativeTags (string): Excluded music styles, used to avoid specific style elements in the replacement segment
- vocalGender (string): Preferred vocal gender. Allowed values:
m(male),f(female) - styleWeight (number): Style adherence weight in range 0–1 (recommended two decimals)
- weirdnessConstraint (number): Creativity/novelty constraint in range 0–1 (recommended two decimals)
- audioWeight (number): Relative weight of audio consistency in range 0–1 (recommended two decimals)
- variety (number): Diversity of generated results. Integer from 0–4, default 1.
0off,1normal (default),2high,3extra,4max. - personaId (string): Persona ID or Suno Voice
voiceId. If you use a Voice-generated ID, setpersonaModeltovoice_persona. - personaModel (string): Persona type. Use
style_personafor Generate Persona IDs, orvoice_personafor Suno Voice IDs. Defaultstyle_persona. - callBackUrl (string): Callback URL for task completion notification. For detailed callback format, see Replace Music Section Callbacks.
Time Range Instructions
infillStartSmust be less thaninfillEndS- Time values are precise to 2 decimal places, e.g.,
10.50seconds - The replacement time must be at least 10 seconds.
- Replacement duration should not exceed 50% of the original music’s total duration
{
"taskId": "2fac****9f72",
"audioId": "e231****-****-****-****-****8cadc7dc",
"prompt": "A calm and relaxing piano track.",
"tags": "Jazz",
"title": "Relaxing Piano",
"negativeTags": "Rock",
"infillStartS": 10.5,
"infillEndS": 20.75,
"fullLyrics": "[Verse 1]\nOriginal lyrics here\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics",
"callBackUrl": "https://example.com/callback"
}
{
"uploadUrl": "https://example.com/audio.mp3",
"model": "V6",
"prompt": "A calm and relaxing piano track.",
"tags": "Jazz",
"title": "Relaxing Piano",
"negativeTags": "Rock",
"infillStartS": 10.5,
"infillEndS": 20.75,
"fullLyrics": "[Verse 1]\nOriginal lyrics here\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics",
"callBackUrl": "https://example.com/callback"
}
Developer Notes
- Replacement segments will be regenerated based on the provided
lyrics/promptandtags. Uselyrics(orprompt) for the replaced segment andfullLyricsfor the complete song. - 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
Authorizations
🔑 API Authentication
All endpoints require authentication using Bearer Token.
Get API Key
- Visit the API Key Management Page to obtain your API Key
Usage
Add to request headers:
Authorization: Bearer YOUR_API_KEY
⚠️ Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately from the management page
Body
- Replace section using existing audio
- Replace section using uploaded custom audio
Original task ID (parent task), used to identify the source music for section replacement.
"2fac****9f72"
Unique identifier of the audio track to replace. This ID is returned in the callback data after music generation completes.
"e231****-****-****-****-****8cadc7dc"
Lyrics for the replaced segment. Required. If lyrics is also provided, lyrics takes priority for the replaced segment.
"A calm and relaxing piano track."
Music style tags, such as jazz, electronic, etc.
"Jazz"
Music title
"Relaxing Piano"
Start time point for replacement (seconds), 2 decimal places. Must be less than infillEndS. The time interval (infillEndS - infillStartS) must be at least 10 seconds.
x >= 010.5
End time point for replacement (seconds), 2 decimal places. Must be greater than infillStartS. The time interval (infillEndS - infillStartS) must be at least 10 seconds.
x >= 020.75
Complete lyrics of the whole song after modification, combining both modified and unmodified lyrics. Distinct from lyrics (and prompt), which apply only to the replaced segment. This field is the full lyrics text used for the entire song after the section replacement.
"[Verse 1]\nOriginal lyrics here\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics"
Lyrics content. Optional. For V6, V6_MINI, and V6_WILD: maximum 5000 characters. Lyrics for the replaced segment only. Distinct from fullLyrics, which is the complete song lyrics.
"[Verse] Night city lights shining bright"
Excluded music styles, used to avoid specific style elements in the replacement segment
"Rock"
Preferred vocal gender. Optional. Allowed values: m (male), f (female).
m, f "m"
Style adherence weight. Optional. Range 0–1, up to 2 decimal places.
0 <= x <= 1Must be a multiple of 0.010.65
Creativity/novelty constraint. Optional. Range 0–1, up to 2 decimal places.
0 <= x <= 1Must be a multiple of 0.010.65
Relative weight of audio consistency versus other controls. Optional. Range 0–1, up to 2 decimal places.
0 <= x <= 1Must be a multiple of 0.010.65
Controls the diversity and stylistic variation of generated results. Optional. Integer from 0–4, default 1.
0: off (exact style) — fully off, strictly the same style1: normal (balanced variety) — default, balances stability and diversity2: high (distinct styles) — produces results with clearly different styles3: extra (bold exploration) — higher variation, encourages bold exploration of different styles4: max (unreasonably varied) — maximum diversity; results may differ in style very significantly
0 <= x <= 4Must be a multiple of 11
Persona ID or Voice ID to apply to the generated music. Optional. When using a Voice-generated ID, set personaModel to voice_persona.
"persona_123"
Persona model type. Optional. style_persona (default) for Generate Persona IDs; voice_persona when personaId is a Suno Voice voiceId. Default style_persona.
style_persona, voice_persona "style_persona"
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
- Alternatively, you can use the get music details interface to poll task status
"https://example.com/callback"
Callbacks
POST{request.body#/callBackUrl}audioGenerated
Body
Response
Callback received successfully
Response status code
- 200: Success - Request processed successfully
- 400: Validation error - Lyrics contain copyrighted content.
- 408: Rate limit exceeded - Timeout.
- 413: Conflict - Uploaded audio matches existing artwork.
- 500: Server error - Unexpected error occurred while processing request
- 501: Audio generation failed.
- 531: Server error - Sorry, generation failed due to issues. Your credits have been refunded. Please try again.
200, 400, 408, 413, 500, 501, 531 Error message when code != 200
"success"
Response
Request successful
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
200, 401, 402, 404, 409, 422, 429, 451, 455, 500 Error message when code != 200
"success"
Show child attributes
Show child attributes
