Batch API
The Batch API allows you to submit multiple lipsync generation requests in a single batch operation, making it efficient to process large volumes of content. This is ideal for scenarios where you need to generate many videos at once, such as personalized video campaigns, content localization, or bulk processing workflows.
Overview
The Batch API processes multiple generation requests asynchronously and provides:
- Bulk Processing: Submit up to 1000 generation requests in a single batch
- Efficient Resource Usage: Batch requests bypass individual generation concurrency limits
- Progress Tracking: Monitor batch progress with detailed metrics
- Webhook Notifications: Receive notifications when batches complete
- Result Downloads: Download batch results as a structured file
Plan Requirements
The Batch API is available for Growth plan subscribers and above. If you’re on a lower-tier plan, you’ll receive a 402 error when attempting to use batch endpoints.
Input Format
Batch requests use JSON Lines (.jsonl) format, where each line contains a separate generation request:
Required Fields
Each line in your .jsonl file must contain:
request_id
: A unique identifier for this specific requestendpoint
: Must be"/v2/generate"
(only supported endpoint currently)payload
: The generation request payload (same format as the Generate API endpoint)
File Constraints
- Maximum file size: 5MB
- Maximum requests per batch: 1000
- File format: JSON Lines (.jsonl)
Dry Run Validation
Before processing a large batch, you can validate your input file format by setting the dry_run
parameter to true
.
Batch Status and Lifecycle
Batches progress through several status states:
PENDING
: Batch created, waiting to start processingPROCESSING
: Generations are being processedCOMPLETED
: All generations finished (successfully or with failures)FAILED
: Batch processing failed entirely
Monitoring Batch Progress
You can monitor the progress of your batch by using the Get Batch endpoint.
Webhook Notifications
When you provide a webhook_url
, you’ll receive POST notifications when your batch completes or fails:
Batch Results
When a batch completes, results are available as a JSON Lines file at the outputUrl
. Each line contains the result for one request in the following format:
The schema for response field is the same as the response for the Generate API endpoint.