docs.sunoapi.org
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
Suno API
Common APIFile Upload API
Suno API
Common APIFile Upload API
  1. Generate Music
  • Suno API Documentation
  • Suno API Quick Start
  • Generate Music
    • Music Generation Callbacks
    • Music Extension Callbacks
    • Upload and Cover Audio Callbacks
    • Upload and Extend Audio Callbacks
    • Add Instrumental Callbacks
    • Add Vocals Callbacks
    • Music Cover Generation Callbacks
    • Replace Music Section Callbacks
    • Generate Music
      POST
    • Extend Music
      POST
    • Upload And Cover Audio
      POST
    • Upload And Extend Audio
      POST
    • Add Instrumental
      POST
    • Add Vocals
      POST
    • Get Music Generation Details
      GET
    • Recovery Audio
      POST
    • Get Recovery Audio Details
      GET
    • Get Timestamped Lyrics
      POST
    • Boost Music Style
      POST
    • Generate Music Cover
      POST
    • Replace Music Section
      POST
    • Get Music Cover Details
      GET
    • Generate Persona
      POST
    • Generate Mashup
      POST
  • Suno Voice
    • Suno Voice Validation Phrase Callbacks
    • Suno Voice Generation Callbacks
    • Suno Voice Regenerate Phrase Callbacks
    • Suno Voice Generate Verification Phrase
      POST
    • Suno Voice Get Verification Phrase
      GET
    • Suno Voice Create Custom Voice
      POST
    • Suno Voice Get Custom Voice Record
      GET
    • Suno Voice Regenerate Verification Phrase
      POST
    • Suno Voice Check Availability
      POST
  • Generate Lyrics
    • Lyrics Generation Callbacks
    • Generate Lyrics
    • Get Lyrics Generation Details
  • Generate Sounds
    • Generate Sounds
  • WAV Conversion
    • WAV Format Conversion Callbacks
    • Convert to WAV Format
    • Get WAV Conversion Details
  • Vocal Removal
    • Audio Separation Callbacks
    • MIDI Generation Callbacks
    • Vocal & Instrument Stem Separation
    • Get Audio Separation Details
    • Generate MIDI from Audio
    • Get MIDI Generation Details
  • Music Video Generation
    • Music Video Generation Callbacks
    • Create Music Video
    • Get Music Video Details
  • Generate Speech
    • Generate Speech
  1. Generate Music

Add Vocals Callbacks

When vocal generation tasks are completed, the system will send results to your provided callback URL via POST request
When you submit a task to the Add Vocals 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:
Vocal generation task completed successfully
Vocal generation task failed
Errors occurred during task processing

Callback Method#

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

Callback Request Format#

When the task is completed, the system will send a POST request to your callBackUrl in the following format:
Success Callback
Failure Callback
{
  "code": 200,
  "msg": "All generated successfully.",
  "data": {
    "callbackType": "complete",
    "task_id": "2fac****9f72",
    "data": [
      {
        "id": "8551****662c",
        "audio_url": "https://example.cn/****.mp3",
        "source_audio_url": "https://example.cn/****.mp3",
        "stream_audio_url": "https://example.cn/****",
        "source_stream_audio_url": "https://example.cn/****",
        "image_url": "https://example.cn/****.jpeg",
        "source_image_url": "https://example.cn/****.jpeg",
        "prompt": "[Verse] Calm and relaxing melodies with soothing vocals",
        "model_name": "chirp-v3-5",
        "title": "Relaxing Piano with Vocals",
        "tags": "relaxing, piano, vocals, jazz",
        "createTime": "2025-01-01 00:00:00",
        "duration": 198.44
      }
    ]
  }
}

Status Code Description#

code · integer · required
Callback status code indicating task processing result:
Status CodeDescription
200Success - Vocal generation completed
400Bad Request - Parameter error, content violation, etc.
451Download Failed - Unable to download related files
500Server Error - Please try again 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 track completed
complete: All tracks completed
error: Task failed
data.task_id · string · required
Task ID, consistent with the taskId returned when you submitted the task
data.data · array
Vocal generation result information, returned on success
data.data[].id · string
Audio unique identifier (audioId)
data.data[].audio_url · string
Generated vocal audio file URL
data.data[].source_audio_url · string · deprecated
Deprecated. Original audio file link returned by Suno. This link expires after a period of time and is no longer maintained — do not rely on it for long-term storage. Use the Recovery Audio endpoint to obtain a fresh playable link.
data.data[].stream_audio_url · string
Streaming vocal audio URL
data.data[].source_stream_audio_url · string
Original streaming vocal audio URL
data.data[].image_url · string
Cover image URL
data.data[].source_image_url · string
Original cover image URL
data.data[].prompt · string
Generation prompt/lyrics describing the vocals
data.data[].model_name · string
Model name used for generation
data.data[].title · string
Vocal track title
data.data[].tags · string
Vocal track tags
data.data[].createTime · string
Creation time
data.data[].duration · number
Audio duration (seconds)

Callback Reception Examples#

Here are example codes for receiving callbacks in popular programming languages:
Node.js
Python
PHP

Best Practices#

Callback URL Configuration Recommendations#

1.
Use HTTPS: Ensure your callback URL uses HTTPS protocol for secure data transmission
2.
Verify Source: Verify the legitimacy of the request source in callback processing
3.
Idempotent Processing: The same taskId may receive multiple callbacks, ensure processing logic is idempotent
4.
Quick Response: Callback processing should return a 200 status code as quickly as possible to avoid timeout
5.
Asynchronous Processing: Complex business logic should be processed asynchronously to avoid blocking callback response
6.
Audio Processing: Audio download and processing should be done in asynchronous tasks to avoid blocking callback response

Important Reminders#

Callback URL must be a publicly accessible address
Server must respond within 15 seconds, otherwise it will be considered a timeout
If 3 consecutive retries fail, the system will stop sending callbacks
Please ensure the stability of callback processing logic to avoid callback failures due to exceptions
Generated audio URLs may have time limits, recommend downloading and saving promptly
Pay attention to content policy compliance to avoid generation failures due to policy violations

Troubleshooting#

If you do not receive callback notifications, please check the following:
Network Connection Issues
Server Response Issues
Content Format Issues
Audio Processing Issues

Alternative Solution#

If you cannot use the callback mechanism, you can also use polling:
Poll Query Results
Use the get music generation details endpoint to regularly query task status. We recommend querying every 30 seconds.
Previous
Add Instrumental Callbacks
Next
Music Cover Generation Callbacks
Built with