Overview
TheVideoBGRemoverClient handles all communication with the VideoBGRemover API for background removal operations. This is the API layer of the SDK - it handles authentication, job management, and credit tracking.
API Layer: This class makes HTTP requests to our servers and consumes credits. For local video composition (no credits), see Composition.
Constructor
- Node.js
- Python
Parameters
| Parameter | Type | Description |
|---|---|---|
api_key | string | Your VideoBGRemover API key (format: vbr_ + 32 characters) |
options.baseUrl | string | API base URL (default: production) |
options.timeout | number | Request timeout in milliseconds (Node.js) or seconds (Python) |
options.headers | object | Additional HTTP headers |
Methods
credits()
Check your current credit balance.- Node.js
- Python
Promise<Credits>Low-Level API Methods
These methods provide direct access to the REST API. Most users should use the high-levelVideo.removeBackground() method instead.
createJobFile()
Create a job for file upload.- Node.js
- Python
createJobUrl()
Create a job for URL download.- Node.js
- Python
startJob()
Start processing a job.- Node.js
- Python
status()
Check job processing status.- Node.js
- Python
wait()
Wait for a job to complete with polling.- Node.js
- Python
Error Handling
The client throws specific exceptions for different error conditions:- Node.js
- Python
Usage with Video Class
The recommended way to use the client is through theVideo class:
- Node.js
- Python
Best Practices
Credit Management
Error Recovery
Timeout Handling
Related Classes
- Video: Video loading and background removal
- Composition: Local video composition
- EncoderProfile: Export format configuration
