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

# Remove Video Background

> Removes the background from a video and optionally replaces it with a solid color or makes it transparent.<br/><br/>
**Input Video Limits:**
  - Max size: 100MB
  - Max duration: 60 seconds
  - Supported formats: MP4, MOV, WebM, MKV, GIF
  - Supported codecs: H.264, H.265/HEVC, VP8, VP9, AV1, ProRes
  - Resolution: 64x64 to 4096x4096 pixels




## OpenAPI

````yaml POST /v1/video/remove-background
openapi: 3.1.0
info:
  description: >-
    The Pixelcut API specification, learn more about the API at at
    https://www.pixelcut.ai/docs
  version: 0.0.2
  title: Pixelcut API
  termsOfService: >-
    https://pixelcut.notion.site/Pixelcut-API-Terms-of-Service-11b3b550490080d89a91e943d010efdf
  contact:
    name: API Support
    email: api@pixelcut.ai
servers:
  - url: https://api.developer.pixelcut.ai
    description: Pixelcut API server
security: []
paths:
  /v1/video/remove-background:
    post:
      tags:
        - Endpoints
      summary: Remove Video Background
      description: >
        Removes the background from a video and optionally replaces it with a
        solid color or makes it transparent.<br/><br/>

        **Input Video Limits:**
          - Max size: 100MB
          - Max duration: 60 seconds
          - Supported formats: MP4, MOV, WebM, MKV, GIF
          - Supported codecs: H.264, H.265/HEVC, VP8, VP9, AV1, ProRes
          - Resolution: 64x64 to 4096x4096 pixels
      operationId: video-remove-background
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - video_url
              properties:
                video_url:
                  $ref: '#/components/schemas/VideoURLParameter'
                background_color:
                  $ref: '#/components/schemas/VideoBackgroundColorParameter'
                output_format:
                  $ref: '#/components/schemas/VideoOutputFormatParameter'
      responses:
        '202':
          description: Accepted - processing has started
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    description: >-
                      A unique identifier for this job that can be used to check
                      status.
                    example: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
          headers:
            Location:
              description: Endpoint to poll for job status
              schema:
                type: string
                example: >-
                  /v1/video/remove-background/job/6ba7b810-9dad-11d1-80b4-00c04fd430c8
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    VideoURLParameter:
      type: string
      format: url
      description: URL of the video to be processed. Must be a publicly accessible URL.
      example: https://example.com/video.mp4
    VideoBackgroundColorParameter:
      type: string
      pattern: ^(transparent|#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6})$
      default: '#000000'
      description: >
        The background color to use after removal.

        - Use "transparent" for transparent background (requires webm_vp9,
        mov_proresks, or gif output format)

        - Use hex code (e.g., "#000000", "#FF5733") for solid color
    VideoOutputFormatParameter:
      type: string
      enum:
        - mp4_h264
        - mp4_h265
        - webm_vp9
        - mov_h265
        - mov_proresks
        - mkv_h264
        - mkv_h265
        - mkv_vp9
        - gif
      default: mp4_h264
      description: >
        Output video format with codec specification. Defaults to `mp4_h264` if
        not specified.


        **Formats:**

        - mp4_h264: MP4 with H.264 codec

        - mp4_h265: MP4 with H.265/HEVC codec

        - webm_vp9: WebM with VP9 codec (supports transparency)

        - mov_h265: QuickTime with H.265 codec

        - mov_proresks: QuickTime with ProRes 4444 codec (supports transparency)

        - mkv_h264: Matroska with H.264 codec

        - mkv_h265: Matroska with H.265 codec

        - mkv_vp9: Matroska with VP9 codec

        - gif: Animated GIF (supports transparency)
  responses:
    Error400:
      description: >-
        The input could not be processed, often returned when the input image
        exceeds API limits.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: A description of the error.
                example: File size too large
              error_code:
                type: string
                enum:
                  - invalid_request_body
                  - missing_parameter
                  - invalid_parameter
                  - unsupported_content_type
                  - malformed_image
                  - unsupported_image_format
                  - file_size_too_large
                  - resolution_too_high
                  - unknown_foreground
                example: file_size_too_large
                description: >
                  The error codes provide a way to programmatically handle
                  errors.  


                  The following error codes are currently in use:  

                  - `invalid_request_body`: The request body was empty or
                  invalid.

                  - `missing_parameter`: A required parameter was not provided.

                  - `invalid_parameter`: A parameter was provided but it was
                  invalid.

                  - `unsupported_content_type`: The content type of the request
                  was not application/json or multipart/form-data.

                  - `malformed_image`: The image could not be decoded.

                  - `unsupported_image_format`: The image format is not
                  supported.

                  - `file_size_too_large`: The image file size is too large.

                  - `resolution_too_high`: The image resolution is too high.

                  - `unknown_foreground`: The foreground subject of the image
                  could not be detected.
    Error401:
      description: The authentication token is missing or invalid.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: API Token not found
              error_code:
                type: string
                enum:
                  - invalid_auth_token
    Error403:
      description: >-
        Returned when you have insufficient credits to perform the requested
        action.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Insufficient credits available
              error_code:
                type: string
                enum:
                  - insufficient_api_credits
    Error429:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Too many requests
              error_code:
                type: string
                enum:
                  - rate_limit_exceeded
    Error500:
      description: Internal service error
  securitySchemes:
    ApiKeyAuth:
      description: >
        All API requests require a valid api key. Include your token as a HTTP
        request header in the following format: `X-API-Key: skXXXXXXXXXXXXXXXX`.
        You can obtain an api key by signing up for developer access in your
        Pixelcut account.
      type: apiKey
      name: X-API-KEY
      in: header

````