Batches
Many requests in one call at the batch price.
- POST
/v1/batchesCreate a batch - GET
/v1/batchesList batches - GET
/v1/batches/{batch_id}Get one batch - GET
/v1/batches/{batch_id}/requestsList a batch's jobs - POST
/v1/batches/{batch_id}/cancelCancel a batch
POST /v1/batches
Create a batch
Up to 1000 video or image requests in one call, at the batch price. Either every request is valid and paid for, or none is created. Batch jobs run when GPUs are free, within the completion window.
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key required | header | string | Required. A new key for each new request, for example a UUID. Send the same key to retry safely: the first result is returned again (200 with Idempotent-Replayed: true) and nothing is created or charged twice. Without it the answer is 400 idempotency_key_required.min length 1; max length 255 |
X-Data-Region | header | string: us, eu, uk, in | Same as data_region in the body. |
Request body
| Field | Type | Description |
|---|---|---|
requests required | array of BatchItem | 1 to 1000 requests. min items 1 |
completion_window | string or null | 1h to 24h. Requests not started by then are cancelled and not charged. Default 24h.max length 4 |
retention | string: 7d, 14d, 28d, zdr or null | How long to keep the output. Defaults to the account's setting. |
data_region | string: us, eu, uk, in or null | Where to store the output. Only valid if it matches the account's region. |
Example
curl -X POST https://api.superveo.io/v1/batches \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"requests": [
{
"custom_id": "poster-1",
"url": "/v1/images/generations",
"body": {
"model": "z-image",
"prompt": "a poster of a red kite",
"size": "1024x1024"
}
},
{
"custom_id": "poster-2",
"url": "/v1/images/generations",
"body": {
"model": "flux2-klein",
"prompt": "a red kite, watercolour",
"aspect_ratio": "3:4"
}
}
],
"completion_window": "24h"
}'import os, uuid, requests
r = requests.request(
"POST", "https://api.superveo.io/v1/batches",
headers={
"Authorization": f"Bearer {os.environ['SUPERVIDEO_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()), # keep it to retry safely
},
json={
"requests": [
{
"custom_id": "poster-1",
"url": "/v1/images/generations",
"body": {
"model": "z-image",
"prompt": "a poster of a red kite",
"size": "1024x1024"
}
},
{
"custom_id": "poster-2",
"url": "/v1/images/generations",
"body": {
"model": "flux2-klein",
"prompt": "a red kite, watercolour",
"aspect_ratio": "3:4"
}
}
],
"completion_window": "24h"
},
)
print(r.status_code, r.json())const r = await fetch("https://api.superveo.io/v1/batches", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SUPERVIDEO_API_KEY}`,
"Idempotency-Key": crypto.randomUUID(), // keep it to retry safely
"Content-Type": "application/json",
},
body: JSON.stringify({
"requests": [
{
"custom_id": "poster-1",
"url": "/v1/images/generations",
"body": {
"model": "z-image",
"prompt": "a poster of a red kite",
"size": "1024x1024"
}
},
{
"custom_id": "poster-2",
"url": "/v1/images/generations",
"body": {
"model": "flux2-klein",
"prompt": "a red kite, watercolour",
"aspect_ratio": "3:4"
}
}
],
"completion_window": "24h"
}),
});
console.log(r.status, await r.json());Responses
GET /v1/batches
List batches
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
limit | query | integer | min 1; max 100; default 20 |
after | query | string | Return what comes after this id (last_id of the previous page). |
Example
curl -X GET https://api.superveo.io/v1/batches \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY"
Responses
| Status | Body | When |
|---|---|---|
| 200 | BatchList | OK |
| 400 | Error | invalid_request |
| 401 | Error | unauthorized |
| 429 | Error | rate_limited |
| 503 | Error | capacity_unavailable |
GET /v1/batches/{batch_id}
Get one batch
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
batch_id required | path | string | Batch id. |
Example
curl -X GET https://api.superveo.io/v1/batches/batch_id \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY"
Responses
| Status | Body | When |
|---|---|---|
| 200 | Batch | OK |
| 401 | Error | unauthorized |
| 404 | Error | not_found |
| 429 | Error | rate_limited |
| 503 | Error | capacity_unavailable |
GET /v1/batches/{batch_id}/requests
List a batch's jobs
The batch's jobs in the order they were sent. Each is a normal job.
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
batch_id required | path | string | Batch id. |
limit | query | integer | min 1; max 100; default 20 |
after | query | string | Return what comes after this id (last_id of the previous page). |
Example
curl -X GET https://api.superveo.io/v1/batches/batch_id/requests \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY"
Responses
| Status | Body | When |
|---|---|---|
| 200 | JobList | OK |
| 400 | Error | invalid_request |
| 401 | Error | unauthorized |
| 404 | Error | not_found |
| 429 | Error | rate_limited |
| 503 | Error | capacity_unavailable |
POST /v1/batches/{batch_id}/cancel
Cancel a batch
Cancels the requests still queued. The ones already generating finish and are billed.
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
batch_id required | path | string | Batch id. |
Example
curl -X POST https://api.superveo.io/v1/batches/batch_id/cancel \
-H "Authorization: Bearer $SUPERVIDEO_API_KEY"
Responses
| Status | Body | When |
|---|---|---|
| 200 | Batch | OK |
| 401 | Error | unauthorized |
| 404 | Error | not_found |
| 429 | Error | rate_limited |
| 503 | Error | capacity_unavailable |