{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Image Upscaler & Background Remover API (4K Bulk Photo)",
    "description": "Upscale blurry images to 4K (Recraft Crisp & SeedVR2) and remove backgrounds (BiRefNet v2) to transparent PNG or pure-white #FFFFFF Amazon/Shopify photos in bulk. Auto WebP/AVIF/CMYK fix, no API key or GPU, zero charge on failed URLs. From $0.011/image — Topaz & remove.bg alternative.",
    "version": "1.0",
    "x-build-id": "BGjGo1Wd1VdAsEbOK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/futurewood~ai-image-upscaler-bg-remover/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-futurewood-ai-image-upscaler-bg-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/futurewood~ai-image-upscaler-bg-remover/runs": {
      "post": {
        "operationId": "runs-sync-futurewood-ai-image-upscaler-bg-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/futurewood~ai-image-upscaler-bg-remover/run-sync": {
      "post": {
        "operationId": "run-sync-futurewood-ai-image-upscaler-bg-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 (Batch up to 100)",
            "maxItems": 100,
            "type": "array",
            "description": "One or more public image URLs (JPEG, PNG, WebP, AVIF, GIF, TIFF, Google Drive, Dropbox, or base64 data URIs). Free Apify plan previews 1 image; paid plans process up to 100 images per run.",
            "default": [
              "https://api.apify.com/v2/key-value-stores/aiPvyqtNsUyarLtrB/records/demo-product-sneaker.jpg"
            ],
            "items": {
              "type": "string"
            }
          },
          "imageFiles": {
            "title": "Or Upload Image File (Optional)",
            "type": "string",
            "description": "Drag and drop a local image file directly from your computer."
          },
          "mode": {
            "title": "Processing Mode",
            "enum": [
              "upscale_crisp",
              "remove_background",
              "ecommerce_studio"
            ],
            "type": "string",
            "description": "Select 4K Crisp Upscale ($0.011–$0.015/img), AI Background Removal ($0.011–$0.015/img), or E-Commerce Studio Combo ($0.018–$0.025/img).",
            "default": "ecommerce_studio"
          },
          "backgroundStyle": {
            "title": "Background Style (for Background Removal & Studio Combo)",
            "enum": [
              "white",
              "transparent",
              "custom_hex"
            ],
            "type": "string",
            "description": "Keep a clean transparent PNG alpha channel, or place the cutout onto a pure-white (#FFFFFF) Amazon/Shopify backdrop or custom brand hex color.",
            "default": "white"
          },
          "spreadsheetUrl": {
            "title": "Google Sheets or CSV File URL",
            "type": "string",
            "description": "Paste a public Google Sheets link (shared as 'Anyone with the link') or direct .csv / .tsv URL containing an image URL column."
          },
          "datasetId": {
            "title": "Or Upstream Apify Dataset ID",
            "type": "string",
            "description": "Optional Apify Dataset ID (e.g. from an Amazon, Shopify, 1688, or AliExpress scraper, or {{resource.defaultDatasetId}} in Actor-to-Actor integrations)."
          },
          "urlField": {
            "title": "Image Column / Field Name",
            "type": "string",
            "description": "Column header in your CSV/Sheet or field path in your Dataset (e.g. imageUrl, image_src, thumbnailUrl, images.0). Auto-detected if left default.",
            "default": "imageUrl"
          },
          "keepFields": {
            "title": "Keep Product Metadata Columns (SKU, ASIN, Title)",
            "type": "array",
            "description": "Optional list of field/column names from your Dataset or CSV (e.g. ['sku', 'asin', 'title']) to copy into each output row under sourceMetadata.",
            "items": {
              "type": "string"
            }
          },
          "customBackgroundColor": {
            "title": "Custom Background Hex Color",
            "pattern": "^#?[0-9A-Fa-f]{6}$",
            "type": "string",
            "description": "Hex color applied when Background Style is set to Custom Solid Color (e.g. #F8FAFC).",
            "default": "#F8FAFC"
          },
          "paddingPercent": {
            "title": "Studio Margin Padding (%)",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Uniform studio margin (0–30%) added around solid-backdrop product photos so items fill ~85–90% of the frame (Amazon main-image best practice).",
            "default": 5
          },
          "skipIfLongEdgeAtLeast": {
            "title": "Smart Skip: Skip Upscale If Longest Edge >= (px)",
            "minimum": 0,
            "maximum": 8192,
            "type": "integer",
            "description": "In upscale_crisp mode, if an input image is already at least this many pixels on its longest side (e.g. 2048 or 3840), skip AI upscaling at $0.00 charge and return its URL cleanly. Set 0 to disable.",
            "default": 0
          },
          "outputFormat": {
            "title": "Output Image Format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "Output file format saved to Key-Value Store. Transparent cutouts automatically stay lossless PNG or WebP.",
            "default": "png"
          },
          "upscaleEngine": {
            "title": "4K Upscale Engine",
            "enum": [
              "auto",
              "recraft_crisp",
              "seedvr2"
            ],
            "type": "string",
            "description": "Auto runs Recraft Crisp Upscale first (best for sharp product edges, labels, and textures) with automatic SeedVR2 failover.",
            "default": "auto"
          },
          "bgModelVariant": {
            "title": "Background Removal Model Variant",
            "enum": [
              "General Use (Heavy)",
              "General Use (Light)",
              "Portrait",
              "Matting"
            ],
            "type": "string",
            "description": "Select the BiRefNet v2 segmentation model tuned for products, portraits, or fine hair/fur.",
            "default": "General Use (Heavy)"
          },
          "maxConcurrency": {
            "title": "Parallel Workers",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Number of images processed concurrently (1–5). Keep at 2–3 for optimal speed and memory stability.",
            "default": 2
          },
          "imageUrl": {
            "title": "Single Image URL Alias (Agent/API Compatibility)",
            "type": "string",
            "description": "Optional singular alias accepted for AI/MCP agents and REST API callers."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}