Complete Workflow
This guide walks through the full flow of generating music with sunor: authenticate, create a task, poll until it completes, and use the audio output.Prerequisites
Step 1: Create a task
Submit a music generation request:task_id with status "pending". Credits are frozen immediately.
Step 2: Poll for results
Tasks take 30 seconds to 5 minutes to complete. Poll every 5-10 seconds until the status is terminal (success, failure, or timeout).
Step 3: Use the output
On success, theoutput.result contains an array of generated clips:
Downloading the audio
Audio URLs point to MP3 files hosted on Suno’s CDN. You can download them directly:Full example
Putting it all together:Next steps
Music generation modes
Learn about inspiration, custom, and continuation modes.
Error handling
Handle errors and implement retries.
Rate limits
Stay within rate limits with smart polling.
API Reference
Full endpoint documentation.