Music
Get Music Status
Retrieves the status and result of a music generation task
Poll this endpoint to check the status of your music generation task.
If the create response includes poll_url, call that URL directly. id and task_id identify the same task; you can also use /v1/tasks/{id}.
An expired or unavailable public task can return 404 async_task_not_found. If task ownership cannot be established for the current API key, the response is 403 task_not_owned.
Path Parameters
The music generation task ID.
Response
Task ID.
Alias of the same asynchronous task ID, when returned.
Preferred polling URL when the create response supplies one.
Task status: pending, processing, completed, or failed.
Optional progress value. Returned only when a real progress value is available; use status to determine completion.
Result fields depend on the operation. Music may return audio_url and audio_id; lyrics-only tasks return lyrics; separation can return multiple files in data. video_url, title, progress, and other metadata are optional. Check status for completion and read the fields actually returned.
Optional source audio ID, usable with this task's ID in supported follow-up operations.
Optional output array, including separated audio files with audio_url or url.
URL to download the audio file (when completed).
URL to the video version with visualizer (when completed).
Generated song title.
Generated or provided lyrics.
Error message (when failed).
Request
curl --fail-with-body "https://api.tokenlab.sh/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-H "Authorization: Bearer sk-your-api-key"Response
{
"id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"task_id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"poll_url": "/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"status": "completed",
"audio_url": "https://cdn.example.com/music/abc123.mp3",
"title": "Night Drive",
"lyrics": "[Verse 1]\nDriving through the night...",
"audio_id": "audio_abc123"
}Authorization
BearerAuth API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
In: header
Path Parameters
The async task ID returned by id / task_id, or embedded in poll_url
Response
application/json
application/json
application/json
application/json