{
 "openapi": "3.0.3",
 "info": {
  "title": "Background removal (default): BiRefNet",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space not-lain/background-removal; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://not-lain-background-removal.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Image utilities and perception",
  "slot": "Background removal",
  "need": "Transparent PNGs for compositing, product shots and 3D inputs.",
  "role": "default",
  "space": "not-lain/background-removal",
  "space_url": "https://huggingface.co/spaces/not-lain/background-removal",
  "model": "BiRefNet",
  "license": "MIT",
  "license_class": "open",
  "gpu_seconds_booked": "60",
  "notes": "Battle-tested and returns a plain transparent PNG, which is the easiest output for agents. Actual compute is a second or two.",
  "caveats": "",
  "lineup_call": "/png(f) \u2192 transparent PNG file\n/image(image) \u2192 slider   \u00b7   /text(url) \u2192 slider",
  "api_style": "v1",
  "mcp_url": "https://not-lain-background-removal.hf.space/gradio_api/mcp/"
 },
 "components": {
  "securitySchemes": {
   "hfToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "Your own Hugging Face token (read scope is enough). It is sent only to the upstream Space and bills that call to your account's ZeroGPU quota. Without it the call runs on the small anonymous quota."
   }
  },
  "schemas": {}
 },
 "paths": {
  "/gradio_api/call/png": {
   "post": {
    "description": "Transparent PNGs for compositing, product shots and 3D inputs. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/png/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/not-lain/background-removal. License: MIT. \n\nUpstream description: Load an image file from disk, remove the background, and save the output as a transparent PNG.\nReturns, in order: Output PNG File: filepath",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "data"
        ],
        "properties": {
         "data": {
          "type": "array",
          "minItems": 1,
          "maxItems": 1,
          "items": {},
          "description": "Positional inputs, in this order:\n0. f: dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any)) (required)"
         }
        }
       }
      }
     }
    },
    "x-gradio-parameters": [
     {
      "name": "f",
      "schema": {
       "type": "object",
       "required": [
        "path",
        "meta"
       ],
       "description": "A file. Set path to a public https URL (or a path returned by POST /gradio_api/upload on the same Space) and meta to {\"_type\": \"gradio.FileData\"}.",
       "properties": {
        "path": {
         "type": "string"
        },
        "url": {
         "type": "string"
        },
        "orig_name": {
         "type": "string"
        },
        "meta": {
         "type": "object",
         "properties": {
          "_type": {
           "type": "string",
           "enum": [
            "gradio.FileData"
           ]
          }
         }
        }
       }
      },
      "required": true,
      "default": null
     }
    ],
    "operationId": "image_utils_background_removal",
    "tags": [
     "Image utilities and perception"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ],
    "summary": "Background removal (default): BiRefNet",
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/gradio_api/call/png/{event_id}": {
   "get": {
    "summary": "Read the result stream for /png",
    "description": "Server-sent events. The final `event: complete` carries a JSON array of outputs; `event: error` means the call failed.",
    "parameters": [
     {
      "name": "event_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SSE stream",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "operationId": "image_utils_background_removal_result",
    "tags": [
     "Image utilities and perception"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}