Usage Guide
- This interface can replace specific time segments in already generated music
- 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
Parameter Details
-
Required Parameters:
taskId: Original music’s parent task IDmusicIndex: Music index to replace (selected from the generated music list)prompt: Prompt describing the replacement segment contenttags: Music style tagstitle: Music titleinfillStartS: Start time point for replacement (seconds, 2 decimal places)infillEndS: End time point for replacement (seconds, 2 decimal places)
-
Optional Parameters:
negativeTags: Music styles to excludecallBackUrl: Callback address after task completion
Time Range Instructions
infillStartSmust be less thaninfillEndS- Time values are precise to 2 decimal places, e.g., 10.50 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
promptandtags - 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
Original task ID (parent task), used to identify the source music for section replacement
"2fac****9f72"
Music index, specifies which song from the generated music list to replace (starting from 0)
0
Prompt for generating the replacement segment, typically text describing the audio content
"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
x >= 010.5
End time point for replacement (seconds), 2 decimal places. Must be greater than infillStartS
x >= 020.75
Excluded music styles, used to avoid specific style elements in the replacement segment
"Rock"
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"
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"
