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
- Cancel queued video jobs when the offer changes: Pro plan example
On Pro, 4 jobs process and 20 wait in the queue (24 accepted). Only queued jobs can be canceled; a started job returns 409 job_generation_already_started.
- 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.
- Caption files: YouTube UTF-8, LinkedIn text-only SRT, Sume burns in
YouTube takes SRT, SBV and more as UTF-8; LinkedIn wants text-only SRT. Sume burns captions in and exports no SRT, so build the file from segments.
- caption_no_speech: caption a silent clip with cues ($0.20)
Sume's caption job fails with caption_no_speech on silent clips. Send cues with text, start and end in seconds to burn authored text without speech-to-text.
Written by Sume