{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/videobackgroundremover-ai/json-schema/videobackgroundremover-ai-export-request-schema.json",
  "title": "ExportRequest",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/videobackgroundremover-ai-openapi.json#/components/schemas/ExportRequest",
  "type": "object",
  "properties": {
    "format": {
      "$ref": "#/$defs/Format"
    },
    "part": {
      "type": "integer",
      "minimum": 1,
      "default": 1,
      "description": "Cannot exceed the job part count."
    },
    "background": {
      "$ref": "#/$defs/Background"
    }
  },
  "required": [
    "format"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "format": {
            "const": "bg_mp4"
          }
        },
        "required": [
          "format"
        ]
      },
      "then": {
        "required": [
          "background"
        ]
      }
    }
  ],
  "$defs": {
    "Background": {
      "description": "Color or gradient replacement. bg_mp4 requires a valid background. Photo backgrounds require a separate browser upload and are outside this script API.",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "color"
            },
            "color": {
              "type": "string",
              "pattern": "^#[0-9a-fA-F]{6}$"
            },
            "x": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.5
            },
            "y": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.5
            },
            "scale": {
              "type": "number",
              "minimum": 0.3,
              "maximum": 2,
              "default": 1
            }
          },
          "required": [
            "type",
            "color"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "gradient"
            },
            "from": {
              "type": "string",
              "pattern": "^#[0-9a-fA-F]{6}$"
            },
            "to": {
              "type": "string",
              "pattern": "^#[0-9a-fA-F]{6}$"
            },
            "angle": {
              "type": "number"
            },
            "x": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.5
            },
            "y": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.5
            },
            "scale": {
              "type": "number",
              "minimum": 0.3,
              "maximum": 2,
              "default": 1
            }
          },
          "required": [
            "type",
            "from",
            "to",
            "angle"
          ]
        }
      ]
    },
    "Format": {
      "type": "string",
      "enum": [
        "hevc_mov",
        "prores",
        "webm",
        "green_mp4",
        "bg_mp4",
        "zip"
      ]
    }
  }
}