The lifecycle of a Suno API task
A generation is not a request-response call. Treating it as one is where most integration bugs start.
The three stages
| Stage | What you have | What to do |
|---|---|---|
| Submit | A task id and two placeholders | Store the id; do not assume audio exists |
| Render | Status moves through queued / generating | Poll every 3-5 seconds, with a timeout in minutes |
| Complete | Audio URL plus fetched assets | Download immediately; the URL is temporary |
Where tasks get lost
- Client timeout treated as failure - the task is still running; query it.
- Not persisting the task id - if your process restarts mid-render you cannot find the result.
- Storing the audio URL instead of a record - URLs expire; store the id and fetch a fresh link.
A minimal, robust loop
task = submit(prompt)
while elapsed < budget:
s = query(task.id)
if s.status in ("complete", "completed"):
return download_url(s.song_id)
if s.status in ("failed", "error"):
raise GenerationFailed(s.reason)
sleep(4)
常见问题 / FAQ
How long does a render usually take?
One to three minutes typically; slower runs are usually waiting on an upstream safety check.
Can I cancel a task?
There is no cancel call; a completed task is simply a song you did not need - render cost is already spent.
Do failed tasks cost anything?
No, they are refunded. Check the task status to tell a failure from a slow render.
Is there an official Suno API? What you can actually use, and what it costs.
注册只需要邮箱,一次生成 0.6 元出 2 首,MP3 与 WAV 下载不限次。
Read the quick start
注册只需要邮箱,一次生成 0.6 元出 2 首,MP3 与 WAV 下载不限次。