Choose Your Approach
There are two main ways to remove backgrounds from videos:π οΈ SDK Method
Best for: Complete workflows, video composition
Language: Node.js, Python
Features: Automatic error handling, progress tracking
π Direct API
Best for: Simple scripts, custom integrations
Language: Any (HTTP requests)
Features: Full control, webhook integration
SDK Method (Recommended)
The easiest way to get started with background removal:- Node.js
- Python
SDK Features
- Automatic Error Handling: SDK catches and explains common errors
- Progress Tracking: Optional callbacks for processing status
- Format Selection: Easy format configuration
- File Management: Handles uploads and downloads automatically
Direct API Method
For custom integrations and maximum control:URL Workflow
Perfect when your videos are already hosted online:1
Create Job from URL
uploaded status (ready to process)2
Start Processing
3
Monitor & Download
completed, then download from provided URLsReal-time Notifications with Webhooks
Instead of polling the status endpoint, get instant notifications when processing completes:File Upload Workflow
For local video files:1
Create Job
2
Upload Video
3
Start Processing
4
Monitor & Download
completed, then download from provided URLsComplete Examples
- cURL - URL Workflow
- cURL - File Upload Workflow
- Node.js SDK - URL Workflow
- Node.js SDK - File Workflow
- Python SDK - URL Workflow
- Python SDK - File Workflow
Error Handling
Common Issues
- Insufficient Credits
- Invalid API Key
- File Too Large
API-Specific Errors
| Error Code | Description | Solution |
|---|---|---|
401 | Invalid API key | Check key format and permissions |
402 | Insufficient credits | Top up your account |
413 | File too large | Reduce file size or use URL workflow |
404 | Job not found | Verify job ID and API key match |
422 | Invalid parameters | Check request format |
Background Options with cURL
Here are the correct cURL commands for different background types:- Color Backgrounds
- Transparent Backgrounds
Format Selection
Choose the format that best fits your workflow:| Format | Best For | File Size | SDK Support |
|---|---|---|---|
| WebM VP9 | Web apps, APIs | Small | β Full support |
| MOV ProRes | Professional editing | Large | β Full support |
| Stacked Video | Universal compatibility | Medium | β Full support |
| Pro Bundle | Advanced workflows | Medium | β Full support |
| PNG Sequence | Frame-by-frame work | Large | β Full support |
Performance Tips
For Large Files
- Use URL workflow for files >100MB
- Process long videos in segments
- Consider reducing resolution before processing
For Batch Processing
- Process videos sequentially, not in parallel
- Implement retry logic for network issues
- Monitor credit usage to avoid depletion
For Production Use
- Use webhooks for real-time notifications (see above)
- Use background threads for processing
- Implement proper error handling and retry logic
- Store job IDs for status tracking
- Monitor your credit usage and balance
