Skip to main content
When you submit a task to the upload and cover audio API, you can use the callBackUrl parameter to set a callback URL. When the task is completed, the system will automatically push the results to your specified address.

Callback Mechanism Overview

The callback mechanism eliminates the need to poll the API for task status. The system will proactively push task completion results to your server.

Callback Timing

The system will send callback notifications in the following situations:
  • Text generation completed (text stage)
  • First covered audio track generated (first stage)
  • All covered audio tracks generated (complete stage)
  • Audio cover task failed
  • Error occurred during task processing

Callback Method

  • HTTP Method: POST
  • Content Type: application/json
  • Timeout: 15 seconds

Callback Request Format

When the task is completed, the system will send a POST request to your callBackUrl in the following format:
{
  "code": 200,
  "msg": "Text generation completed successfully.",
  "data": {
    "callbackType": "text",
    "task_id": "2fac****9f72",
    "data": []
  }
}

Status Code Description

code
integer
required
Callback status code indicating task processing result:
Status CodeDescription
200Success - Audio cover completed
400Bad Request - Invalid upload source or parameter error
401Unauthorized - Invalid API key
413Content Too Long - Prompt or style description exceeds limit
429Insufficient Credits - Account credit balance insufficient
500Server Error - Please retry later
msg
string
required
Status message providing detailed status description
data.callbackType
string
required
Callback type indicating the current callback stage:
  • text: Text generation completed
  • first: First covered audio track generated
  • complete: All covered audio tracks generated
  • failed: Task failed
data.task_id
string
required
Task ID, consistent with the taskId returned when you submitted the task
data.data
array
Audio cover result information, returned on success
data.data[].id
string
Audio unique identifier (audioId)
data.data[].audio_url
string
Covered audio file download link
data.data[].source_audio_url
string
Original covered audio file download link
data.data[].stream_audio_url
string
Streaming audio playback link
data.data[].image_url
string
Music cover image link
data.data[].prompt
string
Cover prompt used
data.data[].model_name
string
AI model name used for cover generation
data.data[].title
string
Covered music title
data.data[].tags
string
Music style tags
data.data[].createTime
string
Creation time
data.data[].duration
number
Covered audio duration (seconds)

Best Practices

Audio Cover Callback Configuration

  1. Upload Validation: Verify that the uploaded audio source is valid and accessible
  2. Style Consistency: Ensure cover style parameters match your artistic vision
  3. Quality Monitoring: Implement quality checks for covered audio output
  4. Original Preservation: Keep track of original upload sources for reference
  5. Version Control: Maintain version history of different cover attempts
  6. Content Rights: Ensure you have rights to cover the uploaded audio content

Cover-Specific Considerations

  • Cover tasks require a valid uploaded audio file
  • The uploaded audio should not exceed 2 minutes in length
  • Cover quality depends on the original upload quality
  • Style transformation may vary based on source material complexity
  • Consider copyright implications when covering existing music

Alternative Solutions

If you cannot use the callback mechanism, you can also use polling:

Poll Cover Results

Use the Get Music Generation Details interface to regularly query cover task status. Recommend querying every 30 seconds.