{
  "openapi": "3.0.1",
  "info": {
    "title": "Background Remover for Images (rembg, CPU)",
    "description": "Remove the background from images in bulk: image URLs in, transparent PNG or WebP out with download links. Optional solid colour background and crop to subject. CPU only, no API key. Direct image files only; softer on hair and fine edges than GPU models.",
    "version": "0.1",
    "x-build-id": "XcXenNE6EYjCmfTLB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~background-remover/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-background-remover",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/data-done-right~background-remover/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-background-remover",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/data-done-right~background-remover/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-background-remover",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to image files (JPEG, PNG, WebP, BMP, GIF, TIFF). Example: https://example.com/product.jpg. Duplicate links are processed once. Page links, HEIC and SVG are rejected without charge.",
            "items": {
              "type": "string"
            }
          },
          "model": {
            "title": "Model",
            "enum": [
              "u2net",
              "u2netp"
            ],
            "type": "string",
            "description": "u2net (default) gave clearly better cut-outs on people and thin parts in our tests. u2netp is about twice as fast and fine for single products on plain backgrounds, but it can lose arms, legs and fine details. Both run on CPU and are Apache-2.0 licensed.",
            "default": "u2net"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "png",
              "webp"
            ],
            "type": "string",
            "description": "File type of each result. Both keep transparency. Example: png.",
            "default": "png"
          },
          "backgroundColor": {
            "title": "Background colour",
            "type": "string",
            "description": "'transparent' (default) or a solid colour as hex, for example #ffffff for white product shots or #f4f4f4. A few names work too: white, black, red, green, blue, yellow, gray.",
            "default": "transparent"
          },
          "cropToSubject": {
            "title": "Crop to subject",
            "type": "boolean",
            "description": "Trim the result to the bounding box of the detected subject, removing the empty margin. Example: true for tight product cut-outs.",
            "default": false
          },
          "maxImagesPerRun": {
            "title": "Max images per run",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Hard cap on images processed in one run (1 to 2000). Images beyond the cap are listed as skipped and are free. Example: 100.",
            "default": 100
          },
          "maxImageSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "number",
            "description": "Larger downloads are rejected (free). Example: 25.",
            "default": 25
          },
          "maxMegapixels": {
            "title": "Max megapixels",
            "minimum": 1,
            "maximum": 50,
            "type": "number",
            "description": "Images with more pixels than this are rejected before decoding (free), to protect memory. 40 megapixels is about 7000 x 5700. Example: 40.",
            "default": 40
          },
          "maxLongSide": {
            "title": "Max long side (pixels)",
            "minimum": 256,
            "maximum": 8192,
            "type": "integer",
            "description": "Images longer than this are downscaled before processing, and the result has the smaller size. The note column says when this happened. Example: 4096.",
            "default": 4096
          },
          "imageTimeoutSecs": {
            "title": "Timeout per image (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Download plus processing time allowed for one image before it is reported as failed. Example: 120.",
            "default": 120
          },
          "outputStoreName": {
            "title": "Output store name",
            "type": "string",
            "description": "Optional name of a key-value store that keeps the result files until you delete it, instead of the run's default store (which expires with the run's data retention). Example: my-cutouts."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}