{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Image Upscaler API: Upscale & Enhance Photos 2x, 4x",
    "description": "Upscale images 2x, 3x or 4x with Real-ESRGAN AI: sharpen low-res, blurry or compressed photos, product shots and anime art from image URLs or an Apify dataset. Keeps transparency. $0.01 per image, no usage fees.",
    "version": "1.0",
    "x-build-id": "x61YQoaspEOUtA8RB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/magnova~ai-image-upscaler/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-magnova-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/magnova~ai-image-upscaler/runs": {
      "post": {
        "operationId": "runs-sync-magnova-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/magnova~ai-image-upscaler/run-sync": {
      "post": {
        "operationId": "run-sync-magnova-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 URLs",
            "type": "array",
            "description": "Direct links to the images to upscale (JPG, PNG, WebP, GIF, BMP, TIFF, AVIF or HEIC). Example: https://example.com/photo.jpg. Use images you own or have rights to.",
            "items": {
              "type": "string"
            }
          },
          "dataset": {
            "title": "Or: Apify dataset with image links",
            "type": "string",
            "description": "Pick a dataset (for example the output of a scraper run). The Actor reads image URLs from each item: it auto-detects fields like imageUrl, image, images, thumbnailUrl or displayUrl, or use 'Image URL field' below."
          },
          "imageUrlField": {
            "title": "Image URL field (dataset only)",
            "type": "string",
            "description": "Field in each dataset item that holds the image URL. Dot paths work, e.g. 'images.0' or 'product.imageUrl'. Leave empty to auto-detect."
          },
          "maxDatasetItems": {
            "title": "Max dataset items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Read at most this many items from the dataset. Example: 100.",
            "default": 1000
          },
          "scale": {
            "title": "Upscale factor",
            "minimum": 2,
            "maximum": 4,
            "type": "integer",
            "description": "How many times larger each side gets: 2, 3 or 4. Example: 4 turns 500x500 into 2000x2000. Automatically lowered if the result would exceed 'Max output megapixels'.",
            "default": 4
          },
          "model": {
            "title": "Model",
            "enum": [
              "photo",
              "anime"
            ],
            "type": "string",
            "description": "'photo' (Real-ESRGAN general v3) for photos, product shots, screenshots and AI art. 'anime' (Real-ESRGAN anime v3) for anime, cartoons, illustrations and line art.",
            "default": "photo"
          },
          "denoise": {
            "title": "Noise and JPEG artifact removal (photo model)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "0 keeps grain and texture, 1 removes noise and compression artifacts strongly (smoother). Example: 0.5. Ignored by the anime model.",
            "default": 0.5
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "auto",
              "jpg",
              "png",
              "webp"
            ],
            "type": "string",
            "description": "'auto' = PNG for images with transparency, WebP for WebP inputs, otherwise JPG. Or force jpg, png or webp.",
            "default": "auto"
          },
          "quality": {
            "title": "JPG/WebP quality",
            "minimum": 50,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for JPG and WebP output, 50-100. Example: 92.",
            "default": 92
          },
          "maxOutputMegapixels": {
            "title": "Max output megapixels",
            "minimum": 0.5,
            "maximum": 36,
            "type": "number",
            "description": "Upper limit for each result's size. The price covers up to 4 MP per image; each started megapixel above 4 is billed as an extra megapixel. Example: 16 (4000x4000). Maximum 36.",
            "default": 16
          },
          "maxFileSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Skip input images larger than this. Example: 40.",
            "default": 40
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}