Replicate Cancel-After header: 5 s to 24 h. Is there a Sume deadline?

Replicate's Cancel-After header sets a prediction deadline from 5 seconds to 24 hours. I found no deadline field in Sume's OpenAPI, so cancel it yourself.

4 min readSume
All posts

Replicate lets you put a deadline on a prediction with a Cancel-After header: a value from 5 seconds to 24 hours, written as 30, 30s, 5m or 2h, and the prediction is canceled automatically if it has not finished. I found no equivalent field in Sume's OpenAPI document: the request fields I searched for, deadline and cancel_after, are not there, and wait_timeout_seconds only bounds how long the HTTP request blocks. On Sume the deadline lives in your client, which polls and calls cancel.

Replicate's header is from its Create a prediction page, read on 2026-10-02. Sume's behaviour is from Jobs and results, and the field search was run on the OpenAPI file shipped with Sume's docs.

What does Cancel-After do on Replicate?

It cancels the prediction itself when the duration passes. Valid values are 5 seconds to 24 hours, as an integer in seconds, or an integer followed by s, m or h. It is not the same as Prefer: wait, which only sets how long the HTTP request stays open.

The page's example sets a 2 minute deadline with Prefer: wait=10: the connection is held 10 seconds, and if the prediction is still running you receive an incomplete prediction object, which keeps running until it completes or reaches the 2 minute deadline.

What does Sume have instead?

wait_timeout_seconds is clamped to 0 to 30 and bounds the blocking HTTP wait only. A client-side timeout does not cancel the job: Sume's docs say it keeps running and still bills, and you have only stopped watching. There is a cancel call, POST /v1/jobs/{job_id}/cancel, but it succeeds only before generation starts; after that it returns 409 job_generation_already_started and the job runs to completion.

So a deadline on Sume protects you only in the queue. If a job is queued when your deadline passes, cancel it and the usage reserve is refunded; if it is processing, you cannot stop it, so your deadline should decide whether you still use the result, not whether the job runs.

How do the two compare?

The control moves from the server to your client.

Replicate's Create a prediction page and Sume's Jobs and results page, read 2026-10-02; Sume field search on its OpenAPI file.
ItemReplicateSume
Server-side deadlineCancel-After header, 5 seconds to 24 hoursNo deadline field found in OpenAPI
HTTP holdPrefer: wait, separate from the deadlinewait_timeout_seconds, 0 to 30
After the deadlinePrediction canceledClient decides; cancel works only before generation starts
Cancel once runningCovered by the deadline409 job_generation_already_started
Client timeoutNot stated on the pageDoes not cancel; job keeps running and billing

How do I enforce my own deadline on Sume?

Submit with mode: "async" and an Idempotency-Key. Poll status_url and honour next_poll_after_seconds. At your cutoff, read the status once more. If it is still queued, call cancel; if cancel returns 409, stop cancelling and decide whether to wait for the result. Never resubmit the same intent to get around a slow job, because that bills a second one.

Pick a cutoff by model: Sume's per-model limits for video come from GET /v1/videos/models, so read the catalog rather than assuming a duration.

Sources

Related posts

More in Comparisons

All Comparisons posts

Written by Sume