Numbers at a glance
Concurrent process limit
This is only enforced for Unlimited quota usage. If your account pays per credit, you may have more than two active jobs — with the consequence of a longer queue.429 as a rescheduling signal.
Daily video quota
It counts videos that succeeded. Failed jobs do not consume quota.dailyVideosRemaining from GET /api/v1/user/credits before sending a batch so that no request dies partway through. The reset uses WIB time, not UTC.
Queue and job lifetime
Every job goes throughqueued → dispatching → processing → a final status. If a worker dies or the upstream service stalls, the job is not left hanging:
- After 2 hours, a job is considered stale, marked
failed, and its credits are refunded. - A job that needs to be picked up again goes through a tolerance window before being dispatched again.
1
Start at 5 seconds
Fetch the first status 5 seconds after the
202.2
Increase gradually
Grow the interval exponentially up to a 30 second ceiling (
5, 8, 12, 20, 30, 30, ...). This is enough because videos usually mature within minutes.3
Stop at the end
As soon as it is
succeeded or failed, stop polling and store the result.4
Cap the total age
Stop your own polling at 2 hours. The server closes the job at the same point.
wait_for_job.js
Backoff when you hit 429
In Vidgen, 429 means “capacity”, not “you are blocked”. Wait, then retry:
- If there is a
Retry-Afterheader (only onPOST /api/v1/upload), honor its value in seconds. - For a
429without the header, wait 30 seconds, then double the wait on each attempt, up to 5 attempts. - If the last attempt still fails, defer the job to the next window and tell the end user.