{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Image Upscaler 2x/4x – Enhance Low-Res Photos (CPU)",
    "description": "Upscale low-res photos 2x or 4x with an AI super-resolution network, on CPU. Pay per image, JPG/PNG/WebP in and out, photo and anime models, up to 8K.",
    "version": "0.1",
    "x-build-id": "6FfhqUhUBxQVhgugo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/far003~ai-image-upscaler-2x-4x/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-far003-ai-image-upscaler-2x-4x",
        "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/far003~ai-image-upscaler-2x-4x/runs": {
      "post": {
        "operationId": "runs-sync-far003-ai-image-upscaler-2x-4x",
        "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/far003~ai-image-upscaler-2x-4x/run-sync": {
      "post": {
        "operationId": "run-sync-far003-ai-image-upscaler-2x-4x",
        "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 JPG, PNG or WebP files, one per line. Up to 50,000 here; use a dataset for more. The standard price covers sources up to photo 1 MP at 2x and 0.9 MP at 4x, anime 0.6 MP at 2x; with allowLarge on, larger sources up to photo 3.9 MP at 2x and 2.12 MP at 4x, anime 2.4 MP at 2x are accepted at the higher price. A bigger image is a free row that tells you what fits. Files up to 40 MB. Duplicates, unreachable links and files that are not images are free.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset ID (optional)",
            "type": "string",
            "description": "A dataset (for example the output of another Actor, such as a website image extractor) whose rows hold image URLs. Its rows are read after the list above."
          },
          "urlField": {
            "title": "URL field in the dataset",
            "type": "string",
            "description": "Name of the field that holds the image URL, e.g. imageUrl or media.link. Leave empty to use the first of url, imageUrl, src, image that a row has. A field that holds a list of URLs is expanded."
          },
          "scale": {
            "title": "Scale",
            "enum": [
              "2x",
              "4x"
            ],
            "type": "string",
            "description": "2x doubles width and height, 4x multiplies them by four (16 times the pixels). Each model and scale has two source size caps, one per price (see allowLarge); a bigger image is free and skipped. Anime has no 4x and the run refuses that combination.",
            "default": "2x"
          },
          "model": {
            "title": "Model",
            "enum": [
              "photo",
              "anime"
            ],
            "type": "string",
            "description": "photo: for photographs and everything realistic, it also cleans JPEG blocking. anime: for anime frames, cartoons and flat-colour illustrations, available at 2x only (anime with 4x is refused when the run starts; use photo for 4x).",
            "default": "photo"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "png",
              "jpg",
              "webp"
            ],
            "type": "string",
            "description": "PNG is lossless (largest files). JPG and WebP are much smaller; JPG has no transparency (it is flattened onto white). EXIF data, GPS and colour profiles are not copied: results are plain sRGB.",
            "default": "png"
          },
          "quality": {
            "title": "JPG / WebP quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "1-100. Ignored for PNG. WebP at 100 is lossless.",
            "default": 92
          },
          "allowLarge": {
            "title": "Allow larger images (event image-large)",
            "type": "boolean",
            "description": "On (default): a source image above the standard size is also enlarged, up to the larger cap of its model and scale (photo 3.9 MP at 2x and 2.12 MP at 4x, anime 2.4 MP at 2x; a 1920 x 1080 frame fits all), and charged at the higher price of the image-large event. Off: only the standard sizes are enlarged (photo up to 1 MP at 2x and 0.9 MP at 4x, anime 0.6 MP) at the lower price; bigger images are free skipped rows.",
            "default": true
          },
          "maxImages": {
            "title": "Maximum images to upscale",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many images were enlarged. Optional; for a hard cap on cost you can also set the maximum cost per run in the run options."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}