{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/snipmat-com/json-schema/snipmat-com-remove-bg-request-schema.json",
  "title": "RemoveBgRequest",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/snipmat-com-openapi.yml#/components/schemas/RemoveBgRequest",
  "type": "object",
  "properties": {
    "image_file": {
      "type": "string",
      "description": "Image file (png/jpeg/webp, ≤25MB, ≤32MP)",
      "format": "binary"
    },
    "image_url": {
      "type": "string",
      "format": "uri",
      "description": "Fetch the image from a public URL instead of uploading"
    },
    "image_file_b64": {
      "type": "string",
      "description": "Base64-encoded image as an alternative to image_file"
    },
    "model": {
      "type": "string",
      "enum": [
        "general",
        "lite",
        "dis"
      ],
      "default": "general",
      "description": "general = best all-round incl. people/hair, opens enclosed holes automatically (default); dis = alternative BiRefNet-DIS model — try it only if general misses something on a product, not for people; lite = faster, smaller model"
    },
    "size": {
      "type": "string",
      "enum": [
        "auto",
        "preview",
        "full"
      ],
      "default": "auto",
      "description": "auto/full = full resolution (free!), preview = ≤0.25MP"
    },
    "format": {
      "type": "string",
      "enum": [
        "auto",
        "png",
        "jpg",
        "webp",
        "zip"
      ],
      "default": "auto",
      "description": "auto = png. zip = color.jpg + alpha.png (remove.bg-compatible)"
    },
    "channels": {
      "type": "string",
      "enum": [
        "rgba",
        "alpha"
      ],
      "default": "rgba",
      "description": "alpha returns only the mask as a grayscale PNG"
    },
    "bg_color": {
      "type": "string",
      "description": "Hex background color, e.g. 81d4fa or #81d4faee"
    },
    "bg_image_url": {
      "type": "string",
      "format": "uri",
      "description": "Public URL of an image to place behind the subject"
    },
    "crop": {
      "type": "boolean",
      "default": false,
      "description": "Crop the canvas to the subject"
    },
    "scale": {
      "type": "string",
      "description": "Subject scale, e.g. \"80%\" (10–100)"
    },
    "position": {
      "type": "string",
      "enum": [
        "original",
        "center"
      ],
      "default": "original"
    },
    "keep_largest": {
      "type": "boolean",
      "default": false,
      "description": "Keep only the largest connected component (drop stray blobs)"
    }
  },
  "required": [
    "image_file"
  ]
}