{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Upscaler & Background Remover (2x/4x, transparent PNG)",
    "description": "Remove image backgrounds (transparent PNG, mask or solid colour) and upscale images 2x or 4x for image URLs you supply. Open-source models run inside the Actor: no external API, no API key. Bulk lists, PNG/JPEG/WebP. $0.0048 per background removal, from $0.0011 per upscaled MP.",
    "version": "0.4",
    "x-build-id": "SrnX6bKkDzc3lCeV8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fecklesspleb~image-upscaler-background-remover/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fecklesspleb-image-upscaler-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/fecklesspleb~image-upscaler-background-remover/runs": {
      "post": {
        "operationId": "runs-sync-fecklesspleb-image-upscaler-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/fecklesspleb~image-upscaler-background-remover/run-sync": {
      "post": {
        "operationId": "run-sync-fecklesspleb-image-upscaler-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",
        "required": [
          "imageUrls"
        ],
        "properties": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to image files (JPEG, PNG, WebP, GIF, BMP, TIFF) that you have the right to edit. Pages of social networks and stock-photo sites are refused. Each download obeys the site's robots.txt and only goes to public internet addresses.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "What to do",
            "enum": [
              "remove-background",
              "upscale",
              "both"
            ],
            "type": "string",
            "description": "Remove the background (transparent PNG), upscale the image, or both.",
            "default": "remove-background"
          },
          "scale": {
            "title": "Upscale factor",
            "enum": [
              "2",
              "4"
            ],
            "type": "string",
            "description": "Used by 'Upscale' and 'Remove background, then upscale'. Upscaling is billed per started megapixel of the output image, with separate prices for 2x and 4x (see README).",
            "default": "2"
          },
          "bgModel": {
            "title": "Background model",
            "enum": [
              "u2net",
              "u2netp"
            ],
            "type": "string",
            "description": "Open-source U²-Net segmentation model used to find the foreground.",
            "default": "u2net"
          },
          "includeMask": {
            "title": "Also save the mask",
            "type": "boolean",
            "description": "Save the black-and-white foreground mask as a separate PNG.",
            "default": false
          },
          "backgroundColor": {
            "title": "Background colour (optional)",
            "pattern": "^$|^#?[0-9a-fA-F]{6}$",
            "type": "string",
            "description": "Empty = transparent. Or a hex colour such as #ffffff to put the cutout on a solid background (then JPEG is possible).",
            "default": ""
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "Transparent results are always PNG or WebP; JPEG applies to upscaled images without transparency and to cutouts on a background colour.",
            "default": "png"
          },
          "jpegQuality": {
            "title": "JPEG/WebP quality",
            "minimum": 50,
            "maximum": 100,
            "type": "integer",
            "description": "Quality for JPEG and WebP output.",
            "default": 90
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "URLs beyond this number are left out (not downloaded, not charged).",
            "default": 20
          },
          "maxFileSizeMb": {
            "title": "Max file size",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Larger downloads are stopped (free skipped row).",
            "default": 20
          },
          "maxInputMegapixels": {
            "title": "Max image size",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Images with more pixels are skipped before decoding (free).",
            "default": 25
          },
          "maxUpscaleInputMegapixels": {
            "title": "Max image size to upscale",
            "minimum": 0.01,
            "maximum": 2,
            "type": "number",
            "description": "Upscaling is skipped (free) for larger inputs. 1 MP (e.g. 1000x1000) becomes 4 MP at 2x or 16 MP at 4x.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}