docs.api.box
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
Suno API
Common APIFile Upload API
Suno API
Common APIFile Upload API
  1. Lyrics Generation
  • API.box Documentation
  • 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
    • Suno Voice Get Verification Phrase
    • Suno Voice Create Custom Voice
    • Suno Voice Get Custom Voice Record
    • Suno Voice Regenerate Verification Phrase
    • Suno Voice Check Availability
  • Lyrics Generation
    • Lyrics Generation Callbacks
    • Generate Lyrics
      POST
    • Get Lyrics Generation Details
      GET
  • 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 and Instrument 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. Lyrics Generation

Lyrics Generation Callbacks

When lyrics generation tasks are completed, the system will send results to your provided callback URL via POST request
When you submit a task to the lyrics generation 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:
Lyrics generation completed (complete stage)
Lyrics generation task failed
Error occurred during task processing
Unlike music generation, lyrics generation has only one callback stage: complete (generation finished)

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:
Lyrics Generation Complete Callback
Lyrics Generation Failed Callback
{
  "code": 200,
  "msg": "All generated successfully.",
  "data": {
    "callbackType": "complete",
    "taskId": "11dc****8b0f",
    "data": [
      {
        "text": "[Verse]\nI cross the city's darkest night\nWith burning dreams inside my heart",
        "title": "Iron Man",
        "status": "complete",
        "errorMessage": ""
      },
      {
        "text": "[Verse]\nThe wind is calling out my name\nSteel armor gleaming in the light",
        "title": "Iron Man",
        "status": "complete",
        "errorMessage": ""
      }
    ]
  }
}

Status Code Description#

code · integer · required
Callback status code indicating task processing result:
Status CodeDescription
200Success - Lyrics generation completed
400Bad Request - Parameter error or content violation
401Unauthorized - Invalid API key
413Content Too Long - Prompt 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, fixed as complete for lyrics generation
data.taskId · string · required
Task ID, consistent with the taskId returned when you submitted the task
data.data · array · required
Generated lyrics list
data.data[].text · string
Lyrics content with verse/chorus structure
data.data[].title · string
Lyrics title
data.data[].status · string
Generation status: complete or failed
data.data[].errorMessage · string
Error message, valid when status is failed

Callback Reception Examples#

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

Best Practices#

Lyrics Processing Recommendations#

1.
Content Filtering: Implement content filtering to ensure lyrics meet your platform's guidelines
2.
Format Preservation: Maintain the verse/chorus structure when processing lyrics
3.
Version Management: Keep track of different lyrics variants for the same prompt
4.
Metadata Storage: Store lyrics along with relevant metadata (title, theme, style)
5.
Text Processing: Consider text processing for formatting, spell checking, or translation
6.
Copyright Compliance: Ensure generated lyrics comply with copyright regulations

Lyrics-Specific Considerations#

Lyrics may contain creative variations that require human review
Generated content should be checked for appropriateness before publication
Multiple variants allow for selection of the best option
Lyrics generation is typically faster than music generation
Content moderation is important for user-generated lyrics prompts

Troubleshooting#

Common issues specific to lyrics generation callbacks:
Content Quality Issues
Language and Style Problems
Content Moderation

Alternative Solutions#

If you cannot use the callback mechanism, you can also use polling:
Poll Lyrics Results
Use the Get Lyrics Generation Details interface to regularly query task status. Recommend querying every 15 seconds for lyrics.
Previous
Suno Voice Check Availability
Next
Generate Lyrics
Built with