How jobs work
Every generation, video or image, is a job. You create it, follow it, and download what it made.
The life of a job
- Create.
POST /v1/images/generations(or/v1/images/edits, and/v1/videosonce video is open) checks the request, holds the most it can cost from your wallet and queues it. A video create answers at once with202and the job; an image create first waits for the result (seePrefer: waitbelow). - Queued.
status: queuedwhile it waits for a GPU.queue_position,eta_secondsandstart_bysay how long.cold_start: truemeans a GPU had to be started for it. - In progress.
status: in_progresswhile it renders.stage(loading_model,sampling,decoding,encoding_video, ...) andprogress(0 to 100) move as it goes. - Final. One of:
completed:outputhas the result. You are charged for what was delivered (usage.cost_usd); the rest of the hold is released.failed:errorsays why. You are not charged.cancelled: you cancelled it while it was queued, or its batch window ended. Not charged.expired: it completed, but its media has since been removed (see retention below).
If a render fails on one GPU it is given to another: the job goes back to queued with a new eta_seconds. You do not need to do anything, and it is charged once, when it completes.
Following a job
Pick one of three ways. All of them read the same job.
Polling. GET the job's polling_url and wait poll_after_ms between reads. Polling one job faster than about once a second gets 429.
curl https://api.superveo.io/v1/images/img_... -H "Authorization: Bearer $SUPERVIDEO_API_KEY"
Send the ETag of your last read as If-None-Match and an unchanged job answers 304 with no body.
Long-polling. Add ?wait=25: the request is held up to 25 seconds and answers as soon as the job changes. One open request per job is plenty.
curl "https://api.superveo.io/v1/images/img_...?wait=25" -H "Authorization: Bearer $SUPERVIDEO_API_KEY"
Server-sent events. GET /v1/images/{id}/events (or /v1/videos/{id}/events) is a text/event-stream. It sends status, stage and progress events as they change, then one job event with the final job, and closes. A : keep-alive comment comes every 15 seconds.
event: status
data: {"status":"queued","eta_seconds":95,"queue_position":2}
event: stage
data: {"stage":"sampling"}
event: progress
data: {"progress":40}
event: job
data: {"id":"img_...","status":"completed","output":{...}, ...}
// Browser or Node 18+. Send the key from your server: never put it in a web page.
const r = await fetch(`${API}/v1/images/${id}/events`, { headers: H });
const reader = r.body.pipeThrough(new TextDecoderStream()).getReader();
for (let chunk; !(chunk = await reader.read()).done; ) console.log(chunk.value);
Each open long-poll or stream counts against your key's stream limit.
Downloading the result
A completed job has an output:
| Field | What it is |
|---|---|
output.url | A signed link to the file. No key needed. It stops working at output.url_expires_at (about an hour); read the job again for a fresh one. Lists return null here. |
output.content_url | A stable address, /v1/images/{id}/content (or /v1/videos/{id}/content). It needs your key and redirects (302) to a fresh signed link. |
output.thumbnail_url | A preview image, when there is one. Also /content?variant=thumbnail. |
output.expires_at | When the media is removed. |
Results stay in Supervideo's storage, in your account's data region; nothing is pushed to you. Download what you want to keep before expires_at.
Retention
How long outputs are kept is set per account (PUT /v1/account/settings) and can be overridden per job with retention: 7d, 14d, 28d, or zdr (zero data retention: removed shortly after the first download, and signed links last 15 minutes). After that the job's status becomes expired and /content answers 410 data_removed.
Idempotency: retrying safely
Every create (POST /v1/images/generations, /v1/images/edits, /v1/videos, /v1/batches) must carry an Idempotency-Key header, 1 to 255 printable characters. Without it the answer is 400 idempotency_key_required.
- Use a new key (a UUID) for each new request.
- After a timeout or a
5xx, send the same request with the same key. If the first one got through you get its job back with200and the headerIdempotent-Replayed: true. Nothing is created or charged twice. - The same key with a different body is
409idempotency_conflict. - If the first request is still being created you get
409idempotency_in_progresswithRetry-After.
Images: Prefer: wait
POST /v1/images/generations and /v1/images/edits hold the request until the image is done, up to Prefer: wait=<seconds> (default 30, at most 60). Done in time: 200 with the completed job. Not done: 202 with a job to poll. Prefer: wait=0 answers at once, like a video. If the image fails while you wait the answer is an error (502 upstream_error, or 422 content_rejected) whose metadata.id is the job.
Limiting the wait: max_wait_s
Set max_wait_s (5 to 1800) on a create to say how long you are willing to wait for a GPU to start the job. If that is not possible the answer is 503 capacity_unavailable with Retry-After, at once, and nothing is queued or charged.
curl -X POST https://api.superveo.io/v1/images/generations \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Prefer: wait=30" \
-H "Content-Type: application/json" \
-d '{
"model": "flux2-klein",
"prompt": "waves rolling onto black sand",
"size": "1024x1024",
"max_wait_s": 120
}'import os, uuid, requests
r = requests.request(
"POST", "https://api.superveo.io/v1/images/generations",
headers={
"Authorization": f"Bearer {os.environ['SUPERVIDEO_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()), # keep it to retry safely
"Prefer": "wait=30",
},
json={
"model": "flux2-klein",
"prompt": "waves rolling onto black sand",
"size": "1024x1024",
"max_wait_s": 120
},
)
print(r.status_code, r.json())const r = await fetch("https://api.superveo.io/v1/images/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SUPERVIDEO_API_KEY}`,
"Idempotency-Key": crypto.randomUUID(), // keep it to retry safely
Prefer: "wait=30",
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "flux2-klein",
"prompt": "waves rolling onto black sand",
"size": "1024x1024",
"max_wait_s": 120
}),
});
console.log(r.status, await r.json());To see the wait before you create, call GET /v1/queue: per model and per speed it gives estimated_start_seconds and whether a job would be accepted. It is free and creates nothing.
Speed
speed: "standard" is the default. speed: "fast" goes ahead of standard jobs in the queue and costs the model's fast_multiplier (2x by default) times the price. It is priority, not a promised start time. If the fast lane is full the job runs, and is billed, as standard: the job's runs_as says which.
Cancelling and deleting
POST /v1/images/{id}/cancel(or/v1/videos/{id}/cancel) works while the job isqueued: the hold is released and nothing is charged. Once it is rendering the answer is409cannot_cancel_in_progressand the job runs to the end.DELETE /v1/images/{id}(or/v1/videos/{id}) removes a finished job's media now and hides the job. No refund.
Listing jobs
GET /v1/images and GET /v1/videos return your jobs newest first, 20 a page (limit up to 100). Pass the page's last_id as after to get the next page while has_more is true.