Start a job
202 Accepted, with a Location header pointing at the job:
402 insufficient_credits.
Get the result
Checkurl until status is final. Start at about once a second and slow down to once every 5 seconds. The Retry-After header on the first response is a good starting point.
Wait in one call
For short work, ask to wait with aPrefer header, up to 60 seconds:
200 with the finished job. If not, you get the usual 202, and the job carries on. A failed job also comes back as 200, so check status.
Results last 1 hour
We delete a result, including any audio, 1 hour after the job finishes.expires_at gives the exact time. To delete it sooner:
Cancel a job
Retry safely
If you aren’t sure a request got through, send it again with the sameIdempotency-Key header. You’ll get the original job back instead of starting and paying for a second one. A key lasts 24 hours, and using one for a different request returns 409 idempotency_conflict. If a job couldn’t start and you got a 503, the same key works for the retry.