Omni Flash edit in sync mode: it waits 30 seconds, then you poll
Sync mode on Sume waits at most 30 seconds. An Omni edit may not finish in that time, so read the job id from the reply and poll it. Never resubmit.

If you send an Omni edit with mode: "sync", Sume holds the request for at most 30 seconds, wait_timeout_seconds max, and then returns the job envelope whether the job is done or not. The docs say what to do when it is not terminal: poll, and do not resubmit. A second submit is a second paid job, unless you reuse the same Idempotency-Key.
What each mode returns
The 30 seconds is a wait budget and not a job duration. Video work can run longer, and the wait can be shorter when waiter capacity is not there. So write the client to accept either outcome: a finished job in the first reply, or an unfinished one with a status URL.
| Mode | First reply | Next step |
|---|---|---|
async | 202 with the job envelope | Poll until terminal is true |
sync | Same envelope after up to 30 s | Terminal: read it. Otherwise poll; do not resubmit |
webhook | 202; Sume stores the callback | Verify the signature; keep polling as a backup |
A client that polls
The sample submits an edit in sync mode and polls if needed. It reads the envelope defensively, because I did not confirm every key name against a live response, and it sends one fixed Idempotency-Key so a retry cannot make a second job.
import json, os, time, urllib.request
BASE = "https://api.sume.com"
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}",
"Content-Type": "application/json"}
def call(url, body=None, extra=None):
req = urllib.request.Request(url, headers={**H, **(extra or {})},
data=json.dumps(body).encode() if body else None)
with urllib.request.urlopen(req, timeout=60) as r:
return json.load(r)
body = {"model": "gemini-omni-flash-1.1", "mode": "sync",
"prompt": "Replace the bottle with an apple. Keep everything else the same.",
"video_url": "https://example.com/clip.mp4", "resolution": "720p"}
env = call(f"{BASE}/v1/video-router/generate", body,
{"Idempotency-Key": "edit-demo-001"})
job = env.get("job", env)
status_url = job.get("status_url") or f"{BASE}/v1/jobs/{job['id']}/status"
while not job.get("terminal"):
time.sleep(5)
job = call(status_url)
job = job.get("job", job)
print(job.get("status"), job.get("result_url"))Before production
Add a deadline to the loop for production, and read result_url only when result_ready is true. If the process dies mid-wait, restart it with the job id from your logs and poll that job; never POST the edit again.
Sources
Related posts
More in Developers
- Omni Flash image-to-video: frame_images or input_references?
frame_images with first_frame pins your photo as the opening frame. A single input_references image conditions the whole clip instead. Pick by what you want.
- One prompt across video models: what to rewrite on Sume
A prompt that works on one Sume video row may need edits on another: Omni uses IMAGE_REF tokens, Kling takes no references, Veo is text-only. Read 2026-10-13.
- Playwright 1.64 lock and --shuffle for a Sume API test suite
Playwright 1.64 adds a describe lock and --shuffle. Use them to test Sume video calls: free 400 checks run in parallel, one paid test holds a credits lock.
- Python preflight: price a video batch before you submit to Sume
A short Python function prices Seedance 2.5 and Wan 3.0 jobs at list x 1.25 and compares the total with your balance before any submit. Example: $99.36.
Written by Sume