Skip to content
VoiceMint Developers

Async jobs

Long-running work (video, image, songs, audio translation, phone calls) runs in the background; start it, wait for it, download the result.

Some work takes longer than an HTTP request should: rendering a video, a song, translating a long recording, a phone call. Those endpoints answer at once with an id and do the work in the background.

The life of a job#

StatusMeaning
queued / pendingaccepted, waiting for capacity
processing / runningin progress
completeddone: the result URL (output_url, audio_url, …) is set
failedit did not work; error says why and the credits are refunded
cancelledyou cancelled it

Credits are reserved when the job starts and the unused part is returned if it fails or is cancelled.

Wait for it#

Poll the status endpoint with backoff (start at 2 seconds, grow to about 15) or let the SDK do it. For phone calls, a webhook (call.ended) is better than polling.

# start a video
curl -X POST https://api.voicemint.io/api/v1/generate/video \
  -H "Authorization: Bearer $VOICEMINT_API_KEY" -H "Content-Type: application/json" \
  -d '{"prompt": "a paper boat sailing down a rainy street", "duration": 5, "aspect_ratio": "9:16"}'
# poll until "completed", then download output_url
curl https://api.voicemint.io/api/v1/generate/GENERATION_ID/status \
  -H "Authorization: Bearer $VOICEMINT_API_KEY"

The SDK helpers per product:

WorkStartWaitResult
Video, imagevideo.generate, image.generatejobs.waitjobs.download(output_url)
Songsmusic.songs.createmusic.songs.waitjobs.download(audio_url)
Audio translationtranslation.create_audio_jobtranslation.wait_jobtranslation.job_result
Phone callscalls.createcalls.waitthe call record (transcript, summary)

A wait that times out does not stop the job; wait again later or cancel it (POST /generate/{id}/cancel).

Downloads#

Result URLs are either API URLs (send your key) or signed storage links that expire (fetch them without the key, and do not store them: store the id and fetch a fresh link). jobs.download handles both and never sends your key to a storage host.