v1

latestOpenAPI 3.0.02026-07-26355125.0 KB
Music 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

OR

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

code200 | 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
msgstring

Error message when code != 200

Example response

{
  "msg": "success",
  "data": {
    "taskId": "5c79****be8e"
  }
}