Create Batch

API for Batch Processing. Available only for Scale and Enterprise plans.

Authentication

x-api-keystring
API Key authentication via header

Request

This endpoint expects a multipart form containing a file.
inputfileRequired

JSON lines file containing batch requests. Minimum 20 records required. Maximum file size: 5MB. Maximum requests per batch: 500.

webhook_urlstringOptional
Optional webhook URL to receive batch completion notifications. A POST request will be sent when the batch completes or fails.
dry_runbooleanOptionalDefaults to false
When true, validates the input file without processing. Returns validation status without creating generations.

Response

This endpoint returns an object.
Batch Responseobject
OR
Validation Responseobject

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
429
Too Many Requests Error
500
Internal Server Error