roasOS
API referenceGenerations

Run a batch

Confirm a batch quote to run it. Reserves the batch credits and starts every generation together. Retrying with the same idempotency key returns the same result.

POST
/v1/generation-batches

Confirm a batch quote to run it. Reserves the batch credits and starts every generation together. Retrying with the same idempotency key returns the same result.

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication. Use your API key as the bearer token: Authorization: Bearer roasos_sk_...

In: header

Header Parameters

Idempotency-Key*string

A unique string that makes retries safe. Any value 16-255 characters; reuse it only when retrying the exact same request.

Match^[A-Za-z0-9._:-]+$
Length16 <= length <= 255
X-RoasOS-Project?string

Optional label to group this request under one of your projects. Appears in your usage records.

Match^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
Length1 <= length <= 64
X-RoasOS-Cost-Center?string

Optional label to attribute this request to a cost center. Appears in your usage records.

Match^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
Length1 <= length <= 64

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/generation-batches" \  -H "Idempotency-Key: stringstringstri" \  -H "Content-Type: application/json" \  -d '{    "batch_quote_id": "99999999-9999-4999-8999-999999999999"  }'
{  "data": {    "kind": "generation_batch",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "processing",    "items": [      {        "item_id": "string",        "generation_id": "a3c889df-e7ae-4ae9-9838-8884129ade5e",        "type": "image",        "status": "processing",        "model": "string",        "reserved_credits": 1      }    ],    "total_reserved_credits": 1,    "created_at": "2019-08-24T14:15:22Z"  }}