KIE.AI
old-model
  • All Model
  • old-model
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
old-model
  • All Model
  • old-model
old-model
  • All Model
  • old-model
Suno API
4o Image APIVeo3.1 APIRunway APIFlux Kontext API
Suno API
4o Image APIVeo3.1 APIRunway APIFlux Kontext API
  1. Music Generation
  • Suno API Quickstart
  • Music Generation
    • Music Cover Generation Callbacks
    • Music Generation Callbacks
    • Music Extension Callbacks
    • Audio Upload and Cover Callbacks
    • Audio Upload and Extension Callbacks
    • Add Instrumental Callbacks
    • Add Vocals Callbacks
    • Replace Music Section Callbacks
    • Generate Music
      POST
    • Extend Music
      POST
    • Upload And Cover Audio
      POST
    • Upload And Extend Audio
      POST
    • Add Instrumental to Music
      POST
    • Add Vocals to Music
      POST
    • Get Music Task Details
      GET
    • Get Timestamped Lyrics
      POST
    • Boost Music Style
      POST
    • Generate Music Cover
      POST
    • Get Cover Generation Details
      GET
    • Replace Music Section
      POST
    • Generate Persona
      POST
    • Generate Mashup Music
      POST
    • Recovery Audio
      POST
  • Lyrics Generation
    • Lyrics Generation Callbacks
    • Generate Lyrics
      POST
    • Get Lyrics Task Details
      GET
  • WAV Conversion
    • Convert to WAV Callbacks
    • Convert to WAV Format
    • Get WAV Conversion Details
  • Vocal Removal
    • Audio Separation Callbacks
    • MIDI Generation Callbacks
    • Vocal & Instrument Stem Separation
    • Get Vocal Separation Details
    • Generate MIDI from Audio
    • Get MIDI Generation Details
  • Music Video Generation
    • Music Video Generation Callbacks
    • Create Music Video
    • Get Music Video Details
  • Sounds Generation
    • Generate sounds
  • voice
    • Suno Voice Generation Callback
    • Suno Voice Validation Phrase Callback
    • Suno Voice Generate Verification Phrase API
    • Suno Voice Get Verification Phrase API
    • Suno Voice Create Custom Voice API
    • Suno Voice Get Custom Voice Records
    • Suno Voice Regenerate Verification Phrase
    • Suno Voice Check Availability API
  1. Music Generation

Music Extension Callbacks

System will call this callback when audio generation is complete
When you submit a music extension task to the Suno API, you can use the callBackUrl parameter to set a callback URL. The system will automatically push the results to your specified address when the task is completed.

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.
Webhook Security
To ensure the authenticity and integrity of callback requests, we strongly recommend implementing webhook signature verification. See our Webhook Verification Guide for detailed implementation steps.

Callback Timing#

The system will send callback notifications in the following situations:
Text generation completed (callbackType: "text")
First audio track generation completed (callbackType: "first")
All audio tracks generation completed (callbackType: "complete")
Audio 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 progresses or completes, the system will send a POST request to your callBackUrl in the following format:
Complete Success Callback
First Track Success Callback
Text Generation Callback
Failure Callback
{
  "code": 200,
  "msg": "All generated successfully.",
  "data": {
    "callbackType": "complete",
    "task_id": "2fac****9f72",
    "data": [
      {
        "id": "e231****-****-****-****-****8cadc7dc",
        "audio_url": "https://example.cn/****.mp3",
        "stream_audio_url": "https://example.cn/****",
        "image_url": "https://example.cn/****.jpeg",
        "prompt": "[Verse] Night city lights shining bright",
        "model_name": "chirp-v4-5",
        "title": "Iron Man",
        "createTime": 1786343609818,
        "duration": 198.44,
        "tags": "electrifying, rock",
        "source_audio_url":"https://example.cn/****.jpeg",
        "source_image_url":"https://example.cn/****.mp3",
        "source_stream_audio_url":"https://example.cn/****"
      },
      {
        "id": "e231****-****-****-****-****8cadc7dc",
        "audio_url": "https://example.cn/****.mp3",
        "stream_audio_url": "https://example.cn/****",
        "image_url": "https://example.cn/****.jpeg",
        "prompt": "[Verse] Night city lights shining bright",
        "model_name": "chirp-v4-5",
        "title": "Iron Man",
        "createTime": 1786343609818,
        "duration": 198.44,
        "tags": "electrifying, rock",
        "source_audio_url":"https://example.cn/****.jpeg",
        "source_image_url":"https://example.cn/****.mp3",
        "source_stream_audio_url":"https://example.cn/****"
      }
    ]
  }
}

Status Code Description#

code (integer, required)#

Callback status code indicating task processing result:
Status CodeDescription
200Success - Request has been processed successfully
400Validation Error - Lyrics contained copyrighted material
408Rate Limited - Timeout
413Conflict - Uploaded audio matches existing work of art
500Server Error - An unexpected error occurred while processing the request
501Audio generation failed
531Server Error - Sorry, the generation failed due to an issue. Your credits have been refunded. Please try again

msg (string, required)#

Status message providing detailed status description

data.callbackType (string, required)#

Callback type indicating the stage of generation:
text: Text generation complete
first: First track complete
complete: All tracks complete
error: Generation failed

data.task_id (string, required)#

Task ID, consistent with the task_id returned when the task was submitted.

data.data (array)#

Array of generated audio data.

data.data[].id (string)#

Unique identifier of the audio.

data.data[].audio_url (string)#

Audio file URL.

data.data[].stream_audio_url (string)#

Streaming audio URL.

data.data[].image_url (string)#

Cover image URL.

data.data[].prompt (string)#

Generation prompt or lyrics.

data.data[].model_name (string)#

Name of the model used.

data.data[].title (string)#

Music title.

data.data[].tags (string)#

Music tags.

data.data[].createTime (integer)#

Creation time.

data.data[].duration (number)#

Audio duration in seconds.

data.data[].source_audio_url(string)#

Source audio file URL.

data.data[].source_image_url(string)#

Source cover image URL.

data.data[].source_stream_audio_url(string)#

Source streaming audio URL.

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 task_id 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.
Handle Multiple Callbacks: Be prepared to receive text, first, and complete callbacks for the same task
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
You may receive multiple callbacks for the same task (text → first → complete)
Please ensure the stability of callback processing logic to avoid callback failures due to exceptions
Handle copyright and conflict errors appropriately (codes 400, 413)
Credit refunds are automatic for certain server errors (code 531)

Troubleshooting#

If you do not receive callback notifications, please check the following:
Network Connection Issues
Confirm that the callback URL is accessible from the public network
Check firewall settings to ensure inbound requests are not blocked
Verify that domain name resolution is correct
Server Response Issues
Ensure the server returns HTTP 200 status code within 15 seconds
Check server logs for error messages
Verify that the interface path and HTTP method are correct
Content Format Issues
Confirm that the received POST request body is in JSON format
Check that Content-Type is application/json
Verify that JSON parsing is correct
Audio Processing Issues
Confirm that audio URLs are accessible
Check audio download permissions and network connections
Verify audio save paths and permissions
Handle both regular and streaming audio URLs appropriately
Process multiple tracks in the same callback
Copyright and Content Issues
Review error messages for copyright violations (code 400)
Check for content conflicts with existing works (code 413)
Ensure compliance with platform content policies
Adjust lyrics or prompts if flagged
Rate Limiting Issues
Handle timeout errors gracefully (code 408)
Implement appropriate retry logic with backoff
Monitor API usage to avoid rate limits
Consider upgrading service plan if needed

Alternative Solution#

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