Whisul generates music asynchronously. When you callDocumentation Index
Fetch the complete documentation index at: https://docs.whisul.com/llms.txt
Use this file to discover all available pages before exploring further.
POST /generate, the API immediately returns a job_id — but the song itself isn’t ready yet. To get the finished track, you call GET /jobs/{job_id} repeatedly until the job reaches a terminal state. This guide explains the job lifecycle, shows you how to poll correctly, and tells you what to do with the result once generation is complete.
How the job lifecycle works
Every generation job moves through one of three states:- running — Whisul is actively generating your song. Keep polling.
- completed — Generation finished successfully. Your song is ready.
- failed — The job could not be completed. No audio was produced.
poll_url field in the POST /generate response contains the exact path to poll — you can use it directly without constructing the URL yourself.
Poll the job endpoint
CallGET /jobs/{job_id} with the same Authorization header you used to submit the job.
cURL
Poll every 5–10 seconds. Polling more frequently than that won’t speed up generation and may trigger rate limiting. Most tracks complete within a few minutes.
Job status responses
- Running
- Completed
- Failed
While the song is being generated, the response looks like this:
Response
result is null and error is null. Continue polling until status changes.Using the song and cover art
Once a job reaches"completed" status, you can use the URLs in the result object directly:
song_url— Link to or stream the generated audio file. You can download it, embed it in a player, or serve it to your users.image_url— Link to the generated cover art image. Use it alongside the audio as album artwork.