Uploads and files
Inputs (first and last frames, reference images, video and audio) can be public https URLs or files you upload. An uploaded file has an id, file_..., that you use in place of a URL. Files are stored in your account's data region and are only usable by your account.
Accepted types:
content_type | Kind |
|---|---|
image/png | image |
image/jpeg | image |
image/webp | image |
video/mp4 | video |
video/webm | video |
video/quicktime | video |
audio/wav | audio |
audio/mpeg | audio |
audio/mp4 | audio |
Small files: one call
POST /v1/files takes multipart/form-data up to 20 MB, checks the file and stores it:
curl https://api.superveo.io/v1/files \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY" \
-F file=@first.png \
-F purpose=input
The answer is a file object with status: processed. Use its id straight away:
{
"id": "file_9b1d...",
"object": "file",
"bytes": 482113,
"filename": "first.png",
"content_type": "image/png",
"kind": "image",
"purpose": "input",
"status": "processed",
"data_region": "us",
"created_at": 1765000000,
"expires_at": 1765604800
}
Any size: direct upload
For larger files, send the bytes straight to storage in three steps.
1. Start the upload with the file's type and exact size:
curl -X POST https://api.superveo.io/v1/uploads \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filename": "first.png",
"content_type": "image/png",
"bytes": 482113
}'import os, uuid, requests
r = requests.request(
"POST", "https://api.superveo.io/v1/uploads",
headers={
"Authorization": f"Bearer {os.environ['SUPERVIDEO_API_KEY']}",
},
json={
"filename": "first.png",
"content_type": "image/png",
"bytes": 482113
},
)
print(r.status_code, r.json())const r = await fetch("https://api.superveo.io/v1/uploads", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SUPERVIDEO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"filename": "first.png",
"content_type": "image/png",
"bytes": 482113
}),
});
console.log(r.status, await r.json());The answer has upload_url, method: "PUT" and the headers to send, and works for 15 minutes.
2. PUT the bytes to upload_url with exactly those headers. No API key: the link is signed.
curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/png" --data-binary @first.png
3. Complete it. The bytes are checked (size, and that the content really is the declared type) and the file becomes usable:
curl -X POST https://api.superveo.io/v1/uploads/upl_.../complete -H "Authorization: Bearer $SUPERVIDEO_API_KEY"
A file that fails the checks gets 422 file_rejected. Calling /complete before the bytes have arrived gets 409 upload_incomplete.
The upload also has a url of the form upload://upl_..., usable as an input reference once complete.
Using a file
Pass the file id where a request takes an input image, for example to edit it:
curl -X POST https://api.superveo.io/v1/images/edits \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Prefer: wait=30" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-edit",
"prompt": "add falling snow",
"image_url": "file_0123456789abcdef0123456789abcdef"
}'import os, uuid, requests
r = requests.request(
"POST", "https://api.superveo.io/v1/images/edits",
headers={
"Authorization": f"Bearer {os.environ['SUPERVIDEO_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()), # keep it to retry safely
"Prefer": "wait=30",
},
json={
"model": "qwen-image-edit",
"prompt": "add falling snow",
"image_url": "file_0123456789abcdef0123456789abcdef"
},
)
print(r.status_code, r.json())const r = await fetch("https://api.superveo.io/v1/images/edits", {
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": "qwen-image-edit",
"prompt": "add falling snow",
"image_url": "file_0123456789abcdef0123456789abcdef"
}),
});
console.log(r.status, await r.json());A URL input must be public https. A reference the API cannot use gets 400 invalid_input_url.
Expiry and deleting
A file is kept for your account's retention period (7d, 14d or 28d; one day for a zdr account), then removed; expires_at says when. Set a shorter life with expires_after: {"anchor": "created_at", "seconds": 86400} on /v1/uploads, or the form field expires_after[seconds] on /v1/files (at least one hour).
DELETE /v1/files/{id} removes a file now. It is refused with 409 file_in_use while an unfinished job still needs it.
GET /v1/files lists your files; GET /v1/files/{id}/content redirects to a signed download link.