{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Image Upscaler: Batch 2x, 3x, 4x Real-ESRGAN",
    "description": "Upscale and sharpen images in bulk with Real-ESRGAN AI. Image links or any dataset field, 2x, 3x, 4x or an exact target size, outputs up to 64 MP, transparency kept, PNG, JPEG or WebP and a ZIP. $0.017 per image; failed and skipped images are free.",
    "version": "0.1",
    "x-build-id": "2BEJs6mfffGGLp8FI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chris_elder~ai-image-upscaler/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chris_elder-ai-image-upscaler",
        "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/chris_elder~ai-image-upscaler/runs": {
      "post": {
        "operationId": "runs-sync-chris_elder-ai-image-upscaler",
        "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/chris_elder~ai-image-upscaler/run-sync": {
      "post": {
        "operationId": "run-sync-chris_elder-ai-image-upscaler",
        "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": {
          "images": {
            "title": "Image links",
            "type": "array",
            "description": "Direct links to the images to upscale (JPEG, PNG, WebP, GIF, BMP, TIFF). One per row, or upload a text file of links. Up to thousands per run.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "scale": {
            "title": "Upscale factor",
            "enum": [
              "2",
              "3",
              "4"
            ],
            "type": "string",
            "description": "How much larger the output should be. 4x turns 500 x 333 into 2000 x 1332.",
            "default": "4"
          },
          "targetLongestSide": {
            "title": "Target longest side (px, optional)",
            "minimum": 64,
            "maximum": 16000,
            "type": "integer",
            "description": "Instead of a fixed factor, upscale every image so its longest side is exactly this many pixels (for example 2048 for marketplaces, 3840 for 4K). Overrides the upscale factor."
          },
          "skipIfAlreadyLarge": {
            "title": "Skip images that already reach the target",
            "type": "boolean",
            "description": "With a target size set, images that are already that big are skipped and not charged.",
            "default": true
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "PNG is lossless and keeps transparency. JPEG is smallest (transparent areas become white). WebP is small and keeps transparency.",
            "default": "png"
          },
          "quality": {
            "title": "JPEG/WebP quality",
            "minimum": 50,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for JPEG and WebP (50 to 100).",
            "default": 92
          },
          "createZip": {
            "title": "Also create a ZIP of all results",
            "type": "boolean",
            "description": "Adds one download link with every upscaled image in a ZIP archive.",
            "default": false
          },
          "datasetId": {
            "title": "Read image links from a dataset (optional)",
            "type": "string",
            "description": "ID of an Apify dataset, for example the output of a product or listing scraper. Links are read from the field below."
          },
          "datasetImageField": {
            "title": "Dataset field with the image link",
            "type": "string",
            "description": "Field name in the dataset items. Dotted paths and lists work, for example images or media.0.url.",
            "default": "imageUrl"
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many images.",
            "default": 500
          },
          "maxInputMegapixels": {
            "title": "Max model input (megapixels)",
            "minimum": 0.1,
            "maximum": 8,
            "type": "number",
            "description": "Larger images are first resized down to this size before the AI pass (2 MP x 4 = up to 32 MP output). Raise it for more detail on big photos; bigger inputs take longer (more platform usage). Up to 8.",
            "default": 2
          },
          "maxOutputMegapixels": {
            "title": "Max output size (megapixels)",
            "minimum": 1,
            "maximum": 100,
            "type": "number",
            "description": "Safety cap on the final image size. 64 MP is about 9200 x 6900.",
            "default": 64
          },
          "maxDownloadMb": {
            "title": "Max download size per image (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Images bigger than this are skipped (not charged).",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}