Cancel queued Sume jobs after queue_full; handle 409 already started
How to free capacity after a 429 queue_full: cancel queued jobs, read job_generation_already_started on running ones, and why a cancel releases the reserve.

Cancel a Sume job with POST /v1/jobs/{id}/cancel; it works only before generation starts. A queued job cancels and releases its reserve, a job already in generation answers 409 job_generation_already_started with details.cancelable: false, and a cancel of an already canceled job simply returns it again.
This is the tool to reach for after 429 queue_full: the docs tell you to wait for a terminal job or cancel queued work you no longer need, then retry the rejected submit with the same idempotency key.
A cancel helper
Run it over the job ids you stored when you submitted; the API only lets the member who created a job cancel it.
import os, requests
API = "https://api.sume.com"
H = {"Authorization": "Bearer " + os.environ["SUME_API_KEY"]}
def cancel(job_id):
r = requests.post(API + "/v1/jobs/%s/cancel" % job_id, headers=H, timeout=30)
if r.status_code == 409:
code = r.json()["error"]["code"]
return "running" if code == "job_generation_already_started" else code
r.raise_for_status()
return "canceled"
stale = ["job_aaa", "job_bbb", "job_ccc"] # ids saved at submit
for job_id in stale:
print(job_id, cancel(job_id))Outcomes
| Job state at cancel | Response | Billing |
|---|---|---|
queued | Canceled | Reserve released |
processing, provider work started | 409 job_generation_already_started | Runs to its end; success captures |
Already canceled | Same canceled job (idempotent) | No change |
completed or failed | Not cancelable | Already settled |
Cancel is not a throttle
Prefer to avoid queue_full by keeping submissions inside your accepted capacity. Cancel stays for work that became unnecessary, such as a campaign that changed after you submitted it.
A recovery routine after queue_full
When a submit returns queue_full, the efficient response is a short routine rather than a retry loop. List the ids you have in flight, check which are still queued, cancel the ones you no longer want, and wait for the rest. Then resend the rejected submit with the same key. Because cancel is idempotent, running the routine twice is harmless.
- Record the job id at submit time; it is the only handle you have to cancel.
- Treat
409 job_generation_already_startedas normal, not as an error to alert on. - Only the member who created a job can cancel it, so a shared worker should use one key per owner.
Sources
Related posts
More in Developers
- Can't choose a video model? Send sume/auto and let Sume pick
model: sume/auto lets Sume select the video family for you: 3 to 10 seconds, 16:9 or 9:16, default 720p and 8 seconds. What it does and does not tell you.
- Cheapest Sume image model for a 21:9 banner from a reference photo
Qwen Image at $0.025 is the cheapest row listing 21:9 with reference input. Flux 2 Pro is next at $0.0375. A short script finds it live.
- Check ad video length for Pinterest, LinkedIn and Google in Python
A short Python check of a video-inspect probe against Pinterest, LinkedIn and Google Video action length limits read on 2026-10-08, before you upload an ad.
- Check Sume webhook signatures in Python with hmac.compare_digest
A Python verifier for the sume-v1 header: raw bytes, constant-time compare, 300 s replay window, empty-secret refusal, and a Flask route that dedupes on job_id.
Written by Sume