Skip to Content
DocumentationModelsVideoVideo Background Removal

Video Background Removal

Use video-background-removal to create video output. This page contains the complete request needed for this model.

Model facts

PropertyValue
Model IDvideo-background-removal
EndpointPOST /api/v1/generation/create
OutputVideo
Modesvideo background removal
PricingView current pricing 

Minimal request

curl -X POST https://api.api-stock.com/api/v1/generation/create \ -H "Authorization: Bearer $API_STOCK_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "video-background-removal", "input": { "videoUrl": "https://example.com/input.mp4" } }'

The create response contains a task ID:

{ "code": 200, "data": { "taskId": "019ca881-9503-7270-a560-f00fc2b15785", "status": "not_started", "createdAt": "2026-08-22T12:00:00.000Z" } }

Parameters

Parameters belong inside the top-level input object. Unknown fields are rejected.

ParameterTypeRequiredDefaultDescription
videoUrlstringYes—Public source video URL. MP4, MOV or WebM, up to 100 MiB.
backgroundColor“transparent” | “black” | “white” | “gray” | “red” | “green” | “blue” | “yellow” | “cyan” | “magenta” | “orange”No"transparent"Background for the output. Transparent backgrounds require WebM.
outputFormat“webm” | “mp4”No"webm"Output format. WebM uses VP9 and supports transparency. MP4 uses H.264 and requires a solid background.
preserveAudiobooleanNotrueKeep the original audio track when possible.

Constraints

  • backgroundColor: allowed: transparent, black, white, gray, red, green, blue, yellow, cyan, magenta, orange.
  • outputFormat: allowed: webm, mp4.
  • The service measures the source video before charging and rounds up to whole seconds. WebM is the default for transparent output.

Invalid types, unsupported enum values, out-of-range numbers, and missing required fields return HTTP 400 with error.code: "invalid_input". Correct the request rather than retrying it unchanged.

Result

Poll the task or provide a top-level webhook URL in the create request:

curl https://api.api-stock.com/api/v1/task/status/$TASK_ID \ -H "Authorization: Bearer $API_STOCK_KEY"

A successful media task returns one or more files:

{ "code": 200, "data": { "taskId": "019ca881-9503-7270-a560-f00fc2b15785", "status": "finished", "files": [ { "fileUrl": "https://s3.api-stock.com/result.mp4", "fileType": "video" } ], "createdTime": "2026-08-22T12:00:00.000Z" } }

See Tasks and webhooks for terminal statuses, retries and webhook delivery.