Saltar a la navegación

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.

Autenticación

x-api-keystring
Autenticación con clave API vía encabezado

Solicitud

This endpoint expects a multipart form containing a file.
inputfileRequerido

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_urlstringOpcional

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_runbooleanOpcionalValor predeterminado: false

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

Respuesta

This endpoint returns an object.
Batch Responseobject
OR
Validation Responseobject

Errores

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