Vercel AI Gateway poll intervalMs and timeoutMs vs Sume polling
AI Gateway's poll option sets intervalMs (5000) and timeoutMs (600000). Sume jobs return next_poll_after_seconds, and your client owns the deadline.

In the AI SDK with AI Gateway, poll.intervalMs is how often the SDK checks job status (default 5000) and poll.timeoutMs is how long it waits before throwing (default 600000, ten minutes). Sume has no such pair of options: a job response carries next_poll_after_seconds when it has one, and the deadline is a number your own client chooses.
Gateway facts are from Vercel's video generation page; Sume facts from Jobs and results and Generation admission, all read 2026-10-01.
What do intervalMs and timeoutMs do in AI Gateway?
Passing a poll option runs the generation as an AI Gateway job instead of one held-open request. The SDK sends a start request, then checks status until the job finishes, so each network request stays short. Vercel also lists poll.delay, a replacement for the timer between checks, meant for a durable workflow's sleep function.
How does Sume tell a client when to poll again?
Submit with mode: "async" and an Idempotency-Key, then read status_url. The docs say to honor next_poll_after_seconds when it is present and to back off otherwise. The loop shape in the docs ends with sleep(s.next_poll_after_seconds or exponential backoff), and it stops when terminal is true.
Who owns the deadline?
You do. The docs say to keep polling until terminal: true, or until your own application deadline, and not to resubmit a paid request just because a local worker timed out. If you need a Gateway-style timeoutMs, write it as a clock check in your loop and keep the job id so a later process can read the same job.
| Control | AI Gateway (video) | Sume job API |
|---|---|---|
| Interval | poll.intervalMs, default 5000 | next_poll_after_seconds when present, else exponential backoff |
| Deadline | poll.timeoutMs, default 600000 | Your application deadline |
| Timer in a workflow | poll.delay replaces the timer | Use your workflow's own sleep in the loop |
| Many jobs | One startVideo per job, store operations | Back off; avoid tight loops across many jobs |
What does a minimal Sume poll loop look like?
The loop below reads the status endpoint named in the docs and enforces a deadline you pick.
const headers = { Authorization: "Bearer " + process.env.SUME_API_KEY };
async function waitForJob(jobId: string, deadlineMs = 600_000) {
const stop = Date.now() + deadlineMs;
let backoff = 2;
while (Date.now() < stop) {
const res = await fetch("https://api.sume.com/v1/jobs/" + jobId + "/status", { headers });
const s = await res.json();
if (s.terminal) return s;
const wait = s.next_poll_after_seconds ?? backoff;
backoff = Math.min(backoff * 2, 30);
await new Promise((r) => setTimeout(r, wait * 1000));
}
return null; // your deadline passed; the job is still yours to read later
}What should I do when my deadline passes?
Do not submit again. Keep the job id, read it later, or cancel it. See poll AI video job status for the status vocabulary.
Sources
Related posts
More in Developers
- AI Gateway startVideo webhookUrl: the same pattern on Sume
experimental_startVideo returns once the job is accepted and can call a webhookUrl. On Sume, send mode webhook with webhook_url and keep polling as backup.
- Video starts on a black frame: fix the first Timeline segment
A render that opens on black usually has a fade or a late first clip. Timeline 1.0 refuses a first start other than 0 and any first-segment transition.
- Vimeo pixel aspect ratio 1:1: setsar in a video filter
Vimeo recommends square pixels (1:1). Sume's video filter allowlist includes setsar, setdar and scale, so a filtergraph can set the sample aspect ratio.
- Wan 3.0 smart duration and adaptive ratio vs Sume's explicit fields
QwenCloud lists smart duration and adaptive aspect ratio for Wan 3.0. On Sume you send an integer duration and an aspect_ratio the model supports.
Written by Sume