v1
latestOpenAPI 3.0.02026-07-26355125.0 KBMusic Generation
Replace Music 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.
post/api/v1/generate/replace-section
Request body
Example request
{
"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"
}Response
Request successful
Example response
{
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}