Retrieve Task
Retrieve an async generation task. The video-to-sfx, text-to-sfx, and audio-ducking endpoints return a task_id; the video-to-music and text-to-music endpoints do too when called with mode=async. Poll this endpoint every 2 to 5 sec until the status is succeeded or failed. Only these async tasks are available here — any other task id returns 404.
GET
/v1/tasks/{task_id}curl "https://api.sonilo.com/v1/tasks/9f5f2f7e-..." \
-H "Authorization: Bearer sk_your_api_key"{
"task_id": "9f5f2f7e-...",
"type": "text_to_sfx",
"status": "processing"
}Authorization
Authenticate via Bearer token. Generate keys at the API Keys page and pass them in the Authorization header on every request.
Authorization: Bearer sk_your_api_keyQuery Parameters
task_idstring (path)requiredThe task_id returned by POST /v1/video-to-sfx, POST /v1/text-to-sfx, POST /v1/audio-ducking, or POST /v1/video-to-music or POST /v1/text-to-music with mode=async.
Response
task_idstringThe task identifier.
typestringThe task type: video_to_sfx, text_to_sfx, audio_ducking, video_to_music, or text_to_music.
statusstringOne of processing, succeeded, or failed.
duration_secondsnumberThe duration of the generated audio or video, in seconds. Present when the task succeeded.
audioobjectPresent when an SFX task succeeded — the generated audio, hosted on Sonilo storage.
audio.urlstringA temporary download URL for the audio file, valid for 7 days.
audio.content_typestringThe audio MIME type — audio/mp4 (m4a, the default) or audio/wav when the request set output_format=wav (video-to-music and text-to-music only).
audio.file_sizeintegerThe audio file size in bytes.
audio[]arrayFor video-to-music and text-to-music tasks, audio is an array of generated audio streams (one entry per parallel output) instead of the single object SFX returns.
audio[].stream_indexinteger0-based index identifying which parallel output stream this entry is.
audio[].sample_rateintegerAudio sample rate in Hz.
audio[].channelsintegerNumber of audio channels.
titleobjectGenerated track title (video-to-music only). Only present when the account's stream event whitelist includes title.
output_urlstringPresent when an audio-ducking task succeeded — a presigned, time-limited download URL for the mixed result.
output_typestringPresent when an audio-ducking task succeeded — audio, or video when the voice input was a video (output_url then points to a new video with the original picture and the ducked audio track).
vocalsobjectPresent when a video-to-music task succeeded with isolate_vocals — the isolated vocals stem.
vocals.urlstringA temporary download URL for the vocals stem, valid for 7 days.
vocals.content_typestringThe vocals file's MIME type, e.g. audio/wav. video-to-music (isolate_vocals) only.
vocals.file_sizeintegerThe vocals file size in bytes. video-to-music (isolate_vocals) only.
mux[]arrayPresent when a video-to-music task succeeded with isolate_vocals — the isolated vocals mixed with the generated music, automatically leveled so the music doesn't bury the vocals, one entry per parallel output stream (same alignment as audio).
mux[].stream_indexinteger0-based index identifying which parallel output stream this mux entry corresponds to.
mux[].urlstringA temporary download URL for the mixed vocals+music file, valid for 7 days.
mux[].content_typestringThe mux file's MIME type — audio/mp4 (m4a, the default) or audio/wav when the request set output_format=wav.
mux[].file_sizeintegerThe mux file size in bytes.
errorobjectPresent when failed — an object with a code and a human-readable message.
refundedbooleanPresent when failed — whether the charge was reversed. Refunds are issued automatically on failure but may take a few sec to be reflected; if false right after a failure, poll once more.
curl "https://api.sonilo.com/v1/tasks/9f5f2f7e-..." \
-H "Authorization: Bearer sk_your_api_key"{
"task_id": "9f5f2f7e-...",
"type": "text_to_sfx",
"status": "processing"
}