API Reference
Base URL: https://api.hypervideo.dev
Full OpenAPI spec available at api.hypervideo.dev/docs (Swagger UI) and /docs.json.
Video Background Removal (Sync)
POST /api/v1/video/remove-background
Processes the video synchronously and returns base64-encoded output directly. Best for shorter videos (<15s). For longer videos, use the async jobs endpoint.
Request
Send as multipart/form-data:
| Parameter | Type | Description |
|---|---|---|
file | File | Video file (MP4, WebM, MOV, AVI). Mutually exclusive with url. |
url | string | URL to a video. Mutually exclusive with file. |
format | string | Single output: webm, webp, apng, stacked-alpha, mov |
formats | JSON array | Multiple outputs. Default: ["webm", "stacked-alpha"] |
tolerance | 0-100 | Background detection sensitivity (default 30) |
fps | 1-60 | Output frame rate (default 24) |
quality | 0-100 | WebP/APNG quality (default 60) |
chromaKey | JSON | Manual color: {"r":0,"g":255,"b":0} |
Response
{ "success": true, "data": { "url": "data:video/webm;base64,...", "format": "webm", "width": 768, "height": 768, "duration": 5.875, "frameCount": 141, "fps": 24, "size": 1597805, "processingTime": 12500, "processingMethod": "chromakey", "detectedBackgroundColor": { "r": 233, "g": 47, "b": 188, "hex": "#E92FBC" }, "outputs": [ { "format": "webm", "url": "data:video/webm;base64,...", "size": 1597805 }, { "format": "stacked-alpha", "url": "data:video/mp4;base64,...", "size": 5242880 } ] }}Example
curl -X POST https://api.hypervideo.dev/api/v1/video/remove-background \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@video.mp4" \ -F "format=webp" \ -F "quality=40"Video Background Removal (Async)
POST /api/v1/jobs/video/remove-background
Submits a job for background removal. Returns immediately with a job ID. See the Async Jobs guide for details.
Get Job Status
GET /api/v1/jobs/:jobId
Polls the status of an async job. Returns progress, stage, and final results when complete.
Image Background Removal
POST /api/v1/image/remove-background
| Parameter | Type | Description |
|---|---|---|
file | File | Image file (JPEG, PNG, WebP, etc.) |
tolerance | 0-100 | Background detection sensitivity (default 30) |
chromaKey | JSON | Manual background color |
edgeSampleSize | number | Pixels from edge to sample (default 50) |
smoothEdges | boolean | Apply edge smoothing (default true) |
Detect Background Color
POST /api/v1/image/detect-background-color
Returns the dominant edge color of an image.
{ "success": true, "data": { "r": 233, "g": 47, "b": 188, "hex": "#E92FBC" }}Smart Processing
The API automatically selects the best processing method based on output format:
| Format | Method | Speed |
|---|---|---|
| WebP, APNG, Stacked-Alpha | AI (BiRefNet / FAL Bria) | ~15-60s |
| WebM, MOV | Chromakey (FFmpeg) | ~10s |
Manual chromaKey applies to chromakey formats but does not switch AI formats away from AI processing.
