Process multiple lipsync generation requests efficiently using the Sync Batch API.
- Python 3.8+
- Sync Scale or Enterprise plan - Batch API is not available on lower-tier plans
- Valid API Key from your Sync account
-
Install dependencies:
pip install -r requirements.txt
-
Configure API credentials:
export SYNC_API_KEY=<your_api_key>
python main.py --input-file input.jsonl --monitorpython main.py --input-file input.jsonlpython main.py --input-file input.jsonl --dry-runpython main.py --batch-id your_batch_id --monitorYour input file must be in JSON Lines format (.jsonl):
{"request_id": "video_001", "endpoint": "/v2/generate", "payload": {"model": "lipsync-2", "input": [{"type": "video", "url": "https://example.com/video1.mp4"}, {"type": "audio", "url": "https://example.com/audio1.wav"}]}}
{"request_id": "video_002", "endpoint": "/v2/generate", "payload": {"model": "lipsync-2", "input": [{"type": "video", "url": "https://example.com/video2.mp4"}, {"type": "audio", "url": "https://example.com/audio2.wav"}]}}request_id: Unique identifier for each requestendpoint: Must be"/v2/generate"payload: Standard generation request payload
- Max file size: 5MB
- Max requests per batch: 1000
- Plan requirement: Scale or Enterprise (you'll get a 402 error on lower plans)
- Results downloaded to local
output.jsonl - Dry run validation: Test input files without creating batches using
--dry-run - Status monitoring: Polls every 60 seconds when
--monitoris used - Validation: Prevents no-op commands (e.g., batch-id without monitor flag)
- Webhook support: Optional real-time notifications