Getting started
Supervideo is one HTTP API for generating images and video. You send a prompt (and, if you like, input images), you get a job, and when the job is done you download the result.
GET /v1/models will list video models when they open.1. Get an API key
Sign in to the console, open API keys and create a key. Copy it when it is shown: it is not shown again. Keep it on your server, never in a web page or a mobile app.
Put it in an environment variable for the examples on this site:
export SUPERVIDEO_API_KEY="<your API key>"
The wallet is prepaid: add credit in the console, or through the API, before your first job.
2. Authenticate
Every request goes to the base URL https://api.superveo.io and carries the key as a bearer token:
Authorization: Bearer <your API key>
A missing, wrong or revoked key gets 401 unauthorized. Check your key with a free call:
curl https://api.superveo.io/v1/account -H "Authorization: Bearer $SUPERVIDEO_API_KEY"
It returns your balance, your limits and your data region.
3. Make your first image
Every create needs an Idempotency-Key header: a new random value (a UUID) for each new request. If the network fails, send the same request again with the same key: you get the first job back instead of a second, paid one.
POST /v1/images/generations holds the request until the image is ready, up to Prefer: wait=<seconds> (default 30, at most 60):
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": "z-image",
"prompt": "a cat on a windowsill, morning light",
"size": "1024x1024"
}'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": "z-image",
"prompt": "a cat on a windowsill, morning light",
"size": "1024x1024"
},
)
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": "z-image",
"prompt": "a cat on a windowsill, morning light",
"size": "1024x1024"
}),
});
console.log(r.status, await r.json());Ready in time: 200 with the finished job (shortened):
{
"id": "img_7f3c...",
"object": "image",
"status": "completed",
"model": "z-image",
"size": "1024x1024",
"progress": 100,
"max_cost_usd": 0.004,
"output": {
"url": "https://storage.googleapis.com/...",
"url_expires_at": 1765004000,
"content_url": "https://api.superveo.io/v1/images/img_7f3c.../content",
"width": 1024,
"height": 1024
},
"usage": {"images": 1, "cost_usd": 0.004},
"error": null
}
Not ready in time: 202 with the same job, status: queued or in_progress, to follow until it is done. The most the job can cost (max_cost_usd) is held from your wallet; when it completes you pay for what was delivered and the rest is released. A failed job costs nothing.
4. The whole thing, end to end
Create, follow the job if it was not ready within the wait, then download output.url:
import os, time, uuid, requests
API = "https://api.superveo.io"
H = {"Authorization": f"Bearer {os.environ['SUPERVIDEO_API_KEY']}"}
# 1. Create. Keep the Idempotency-Key: sending the same key again never makes a second job.
# Prefer: wait=30 holds the request until the image is ready (200), or up to 30 s (then 202).
r = requests.post(f"{API}/v1/images/generations",
headers={**H, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=30"},
json={
"model": "z-image",
"prompt": "a red kite over a beach at sunset",
"size": "1024x1024"
})
if r.status_code >= 400:
raise SystemExit(r.json()["error"]) # code, message: see the Errors page
job = r.json()
# 2. Not done within the wait? Follow it until it is final.
while job["status"] in ("queued", "in_progress"):
time.sleep((job["poll_after_ms"] or 2000) / 1000)
job = requests.get(job["polling_url"], headers=H).json()
# 3. Download.
if job["status"] == "completed":
image = requests.get(job["output"]["url"]) # signed link, no key needed
open("kite.png", "wb").write(image.content)
print("cost", job["usage"]["cost_usd"], "USD")
else:
print(job["status"], job["error"])
const API = "https://api.superveo.io";
const H = { Authorization: `Bearer ${process.env.SUPERVIDEO_API_KEY}` };
const r = await fetch(`${API}/v1/images/generations`, {
method: "POST",
headers: { ...H, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=30", "Content-Type": "application/json" },
body: JSON.stringify({"model": "z-image", "prompt": "a red kite over a beach at sunset", "size": "1024x1024"}),
});
if (!r.ok) throw new Error(JSON.stringify((await r.json()).error));
let job = await r.json();
while (job.status === "queued" || job.status === "in_progress") {
await new Promise((ok) => setTimeout(ok, job.poll_after_ms ?? 2000));
job = await (await fetch(job.polling_url, { headers: H })).json();
}
console.log(job.status, job.output?.url ?? job.error);
There are three ways to follow a job, all described in How jobs work: polling every poll_after_ms, long-polling with ?wait=25, and a server-sent event stream.
5. Video
Video generation is coming soon. It will use the same job object as images: POST /v1/videos answers at once with a job to follow. See the Videos reference to plan for it. Until a video model appears in GET /v1/models, a video request is refused with model_not_found.
What next
- How jobs work: statuses, waiting, downloading, retries.
- Models and modes: what each model can do and the sizes it takes.
- Uploads and files: send your own input images.
- Errors: every error code and what to do about it.
- API reference: every endpoint, field and response. Also as Swagger UI, Redoc and openapi.json.