> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poyo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Video Background Removal

> Remove the background from a video and return a transparent or solid-color result.

> [!TIP]
>
> 1. After submission, a `task_id` will be returned. If you provided a `callback_url`, when the task status becomes `finished` or `failed`, a POST request will be sent to the `callback_url`.
> 2. Regardless of whether `callback_url` is provided, you can retrieve the response result through the unified [Query Task Status](https://docs.poyo.ai/api-manual/task-management/status.md) endpoint.

Video Background Removal separates the subject from the background in one video. Return the result with a transparent background or a solid color, in the container and codec you choose.

## Models

* **poyo-ai/video-background-removal** — Remove the background from one video

## Required parameters

* `video_url` (string): Source video URL.

## Optional parameters

* `output_container_and_codec` (string): `mp4_h265`, `mp4_h264`, `webm_vp9`, `mov_h265`, `mov_proresks`, `mkv_h265`, `mkv_h264`, `mkv_vp9`, or `gif`.
* `preserve_audio` (boolean): Whether to keep the source audio track.
* `background_color` (string): `Transparent`, `Black`, `White`, `Gray`, `Red`, `Green`, `Blue`, `Yellow`, `Cyan`, `Magenta`, or `Orange`. Case-sensitive.

## Output

A finished task returns one video in `files` with `file_type: video`, encoded with the requested `output_container_and_codec`.

## Examples

* **Transparent background as WebM** — sets `video_url`, `background_color`, `output_container_and_codec`, `preserve_audio`.
* **Green screen as MP4** — sets `video_url`, `background_color`, `output_container_and_codec`.

## Notes

* Optional fields that are omitted use the provider defaults.
* For a transparent result, pair `Transparent` with a container that supports an alpha channel, such as `webm_vp9` or `mov_proresks`.
* PoYo reads the video duration before submitting. Submission fails if the duration cannot be determined.


## OpenAPI

````yaml api-manual/tools-series/video-background-removal.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Video Background Removal
  description: Remove the background from a video.
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      summary: Submit a video background removal task
      operationId: submit_video_background_removal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              transparent:
                summary: Transparent background as WebM
                value:
                  model: poyo-ai/video-background-removal
                  input:
                    video_url: https://example.com/dancer.mp4
                    background_color: Transparent
                    output_container_and_codec: webm_vp9
                    preserve_audio: true
              green:
                summary: Green screen as MP4
                value:
                  model: poyo-ai/video-background-removal
                  input:
                    video_url: https://example.com/dancer.mp4
                    background_color: Green
                    output_container_and_codec: mp4_h264
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      additionalProperties: false
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - poyo-ai/video-background-removal
          description: Public model identifier.
        callback_url:
          type: string
          format: uri
          description: Optional webhook URL for task completion or failure notifications.
        input:
          type: object
          additionalProperties: false
          required:
            - video_url
          properties:
            video_url:
              type: string
              format: uri
              description: >-
                Source video URL. Must be a publicly accessible HTTP or HTTPS
                URL.
            output_container_and_codec:
              type: string
              enum:
                - mp4_h265
                - mp4_h264
                - webm_vp9
                - mov_h265
                - mov_proresks
                - mkv_h265
                - mkv_h264
                - mkv_vp9
                - gif
              description: >-
                Output container and codec. Choose a format that supports
                transparency, such as `webm_vp9` or `mov_proresks`, when
                `background_color` is `Transparent`. When omitted, the provider
                default is used.
            preserve_audio:
              type: boolean
              description: >-
                Whether to keep the source audio track. When omitted, the
                provider default is used.
            background_color:
              type: string
              enum:
                - Transparent
                - Black
                - White
                - Gray
                - Red
                - Green
                - Blue
                - Yellow
                - Cyan
                - Magenta
                - Orange
              description: >-
                Background to put behind the subject. Values are case-sensitive.
                When omitted, the provider default is used.
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1793176000-example
            status:
              type: string
              enum:
                - not_started
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-10-28T10:30:00'
    ErrorResponse:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: integer
          example: 400
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: validation_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.