Passer à la navigation

Create Batch

Create a batch processing job from a JSONL file. Requires the Scale plan. Send the file in multipart field input (or the accepted file alias); it must be 5 MB or smaller and contain 20-500 records by default. Each line must contain request_id, endpoint exactly /v2/generate, and a generation payload.

Authentification

x-api-keystring
Authentification par clé API via en-tête

Requête

This endpoint expects a multipart form containing a file.
inputfileRequis

JSONL file containing batch requests. Send it in multipart field input (or file alias). Each non-empty line must contain request_id, endpoint exactly /v2/generate, and payload as a CreateGenerationDto object. Minimum 20 records required, maximum 500 records by default, no duplicate request_id values, and maximum file size 5 MB.

webhook_urlstringOptionnel

Optional webhook URL to receive batch completion notifications. A POST request will be sent when the batch completes or fails, with a Sync-Signature header (t=<unix>,v1=<hmac_sha256>) signed with the organization webhook secret.

dry_runbooleanOptionnelPar défaut false

When true, validates the JSONL file and returns { "status": "VALIDATED" } without creating a batch.

Réponse

This endpoint returns an object.
Batch Responseobject
OR
Validation Responseobject

Erreurs

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