Batch Processing
The Batch API allows you to process multiple lipsync generation requests asynchronously in a single operation. This is ideal for bulk video processing, personalized video campaigns, content localization, or any scenario requiring high-volume generation.
Overview
Batch processing enables you to submit upto 500 generations without having to handle queueing/concurrency, with a turn-around-time of 24 hrs. As of now, only generations with inputs upto 30s are supported in batch processing.
Batch API is available for Scale and Enterprise users only
Getting Started
Prepare Your Input File
Create a JSON Lines (.jsonl) file with your generation requests. Each line should contain a unique request_id
, the endpoint
(must be "/v2/generate"
), and a payload
with the standard generation request format (same as the Generate API). The file must be in JSON Lines (.jsonl) format with a minimum of 20 records, maximum file size of 5MB, and up to 500 requests per batch.
Create a Batch
Optional parameters:
webhook_url
: Receive notifications when the batch completesdry_run
: Set totrue
to validate your input file without processing
Check Batch Status
Monitor your batch progress by polling the status:
A batch can have one of the following status:
PENDING
: Batch created, waiting to start processingPROCESSING
: Generations are being processedCOMPLETED
: All generations finished (successfully or with failures)FAILED
: Batch processing failed entirely
Check Batch Results
When a batch completes, results are available as a JSON Lines file at the outputUrl
of the get batch response. Each line contains:
The response
field contains the same data as individual Generate API responses.
For a complete working example, see the batch processing example in our examples repository.
Webhook Notifications
When you provide a webhook_url
, you’ll receive POST notifications when your batch completes: