How many jobs_wait calls does a long video job need? 50 s slices
At the default 50 s slice a 10-minute render needs up to 12 jobs_wait calls, at the 55 s cap up to 11. Write the call budget into the agent instruction.

A long video job needs as many jobs_wait calls as it has 50-second slices. On hosted Sume MCP the default timeout_seconds is 50 and the cap is 55, so a 10-minute render takes at most 12 calls at the default and at most 11 at the cap. A wait returns the moment the job is terminal, so these counts are ceilings, not predictions.
Why the slice is short
Sume documents the slice as a bound enforced by the server. A wait is one HTTP request held open with no data moving, and every edge between your client and the server closes such a request eventually. The API accepts larger values up to 600 and clamps them, and the response tells you about the clamp in wait_slice_clamped. So the answer to a long render is to wait again, never to ask for a longer wait.
The arithmetic
Take a job that runs for the given minutes. The ceiling is the ceiling of seconds divided by slice length, as the table shows. Use it to decide how many tool calls an agent loop may spend before it stops and reports.
| Job length | Seconds | Calls at 50 s | Calls at 55 s |
|---|---|---|---|
| 1 minute | 60 | 2 | 2 |
| 5 minutes | 300 | 6 | 6 |
| 10 minutes | 600 | 12 | 11 |
| 20 minutes | 1200 | 24 | 22 |
Transport errors are not job failures
A 524, 522, 523 or 525 from jobs_wait is a transport failure, never a job outcome. The job keeps running and billing. Issue the wait again on the same ids, or read jobs_status once. Do not submit the paid create again, and do not report the job as blocked. The call budget and the retry rule belong in the same instruction, so the agent never confuses a closed connection with a failed render.
Batch the wait
After a fan-out, one batch call beats many single calls. jobs_wait takes job_ids with between 1 and 20 ids and an optional wait_for of all or any, with all as the default. With any, the other jobs still run and still bill, so use it only when you really want the first finished clip.
A budget you can paste
The helper below turns a job length into a call budget and a deadline you can paste into a prompt. It is plain arithmetic, so run it before you write the agent instruction.
import math
def wait_calls(job_minutes, slice_seconds=50):
return math.ceil(job_minutes * 60 / slice_seconds)
def instruction(job_minutes):
n = wait_calls(job_minutes)
return ("Call jobs_wait with the same job ids up to " + str(n) +
" times. On wait_slice_expired or a 52x error, wait again. "
"Never create the job again. After that, read jobs_status and report.")
def main():
for minutes in (1, 5, 10, 20):
print(minutes, wait_calls(minutes), wait_calls(minutes, 55))
print(instruction(10))
main()Sources
Related posts
More in Developers
- How to cap a Sume Format run's spend: $500 ceiling, $400 default
Send generation_spend_cap_usd on each Format run. A value above 500 returns 400, a Format with no cap defaults to 400, and a run past its cap fails.
- Retry a lip-sync submit after a timeout without double billing
A timed-out submit may or may not have created a job. Resend the same body with the same Idempotency-Key and Sume returns the same job, not a second charge.
- Idempotency-Key per shot: rerun one failed AI video shot in Python
One key per shot, derived from project, shot number and revision: a retry returns the same Sume job, a changed prompt gets a new key. Python key helper inside.
- Chain Ideogram 4.5 edits with webhooks: job.completed starts pass 2
Run a multi-turn Ideogram 4.5 edit chain on Sume without polling: submit with mode webhook, verify the signature, and start the next pass from job.completed.
Written by Sume