{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Tools",
    "description": "Resize, crop, rotate, convert, compress and watermark an image in one call. Reads JPEG, PNG, GIF, WebP, TIFF, BMP, HEIC and AVIF. Built to be safe to hand to an AI agent: typed, allowlisted operations instead of an ImageMagick command line, and a clear refusal when the file is not really an image.",
    "version": "0.1",
    "x-build-id": "oirMhnsTbriWtCry2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/marcel-rbro~image-tools/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-marcel-rbro-image-tools",
        "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/marcel-rbro~image-tools/runs": {
      "post": {
        "operationId": "runs-sync-marcel-rbro-image-tools",
        "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/marcel-rbro~image-tools/run-sync": {
      "post": {
        "operationId": "run-sync-marcel-rbro-image-tools",
        "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": {
          "files": {
            "title": "Images",
            "maxItems": 100,
            "type": "array",
            "description": "The images to work on. Upload up to 100 files, or pass a list of direct URLs. Accepts JPEG, PNG, GIF, WebP, TIFF, BMP, HEIC and AVIF."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "jpeg",
              "png",
              "webp",
              "avif",
              "tiff",
              "gif"
            ],
            "type": "string",
            "description": "Leave empty to keep the source format, which is what you want for a pure resize or crop."
          },
          "quality": {
            "title": "Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for JPEG, WebP and AVIF. Ignored by the lossless formats.",
            "default": 90
          },
          "width": {
            "title": "Width",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Target width in pixels. Give width, height, or both."
          },
          "height": {
            "title": "Height",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Target height in pixels."
          },
          "resizeFit": {
            "title": "Resize behaviour",
            "enum": [
              "inside",
              "force",
              "grow"
            ],
            "type": "string",
            "description": "\"Fit inside\" keeps the aspect ratio and never upscales a smaller image.",
            "default": "inside"
          },
          "cropWidth": {
            "title": "Crop width",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Width of the region to keep. Both crop width and crop height are needed for a crop to happen."
          },
          "cropHeight": {
            "title": "Crop height",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Height of the region to keep."
          },
          "cropGravity": {
            "title": "Crop from",
            "enum": [
              "center",
              "north",
              "south",
              "east",
              "west",
              "northeast",
              "northwest",
              "southeast",
              "southwest"
            ],
            "type": "string",
            "description": "Which part of the image the crop region is anchored to. Cropping by gravity means you do not need to know the source dimensions.",
            "default": "center"
          },
          "rotate": {
            "title": "Rotate (degrees)",
            "minimum": -359,
            "maximum": 359,
            "type": "integer",
            "description": "Clockwise rotation. Angles that are not multiples of 90 expose the background colour."
          },
          "flipVertical": {
            "title": "Flip vertically",
            "type": "boolean",
            "description": "Mirror top to bottom.",
            "default": false
          },
          "flipHorizontal": {
            "title": "Flip horizontally",
            "type": "boolean",
            "description": "Mirror left to right.",
            "default": false
          },
          "grayscale": {
            "title": "Grayscale",
            "type": "boolean",
            "description": "Convert to shades of gray.",
            "default": false
          },
          "blur": {
            "title": "Blur",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Blur radius. 0 is off; 3 to 8 is a normal soft blur."
          },
          "background": {
            "title": "Background colour",
            "type": "string",
            "description": "Used when rotating off-axis, and when flattening transparency into a format that has none, such as JPEG. A colour name or a hex value like #ffffff. Anything else falls back to white.",
            "default": "white"
          },
          "watermarkText": {
            "title": "Watermark text",
            "type": "string",
            "description": "Short caption drawn onto the image. Limited to 120 characters."
          },
          "watermarkGravity": {
            "title": "Watermark position",
            "enum": [
              "southeast",
              "southwest",
              "northeast",
              "northwest",
              "center",
              "north",
              "south",
              "east",
              "west"
            ],
            "type": "string",
            "description": "Where the caption sits.",
            "default": "southeast"
          },
          "watermarkColour": {
            "title": "Watermark colour",
            "type": "string",
            "description": "A colour name or hex value. Anything else falls back to white.",
            "default": "white"
          },
          "watermarkSize": {
            "title": "Watermark size",
            "minimum": 8,
            "maximum": 400,
            "type": "integer",
            "description": "Point size. Leave empty to let ImageMagick choose."
          },
          "keepMetadata": {
            "title": "Keep metadata",
            "type": "boolean",
            "description": "Keeps EXIF, which on phone photos includes the camera, the timestamp and the GPS location. Turn off to strip it before sharing. The colour profile is kept either way.",
            "default": true
          },
          "imageBase64": {
            "title": "Image as base64",
            "type": "string",
            "description": "Alternative to the image field for API callers: the source file encoded as base64."
          },
          "filename": {
            "title": "Filename for base64 input",
            "type": "string",
            "description": "Original filename to use when the image is passed as base64."
          },
          "verboseLog": {
            "title": "Verbose log",
            "type": "boolean",
            "description": "Includes the full ImageMagick output in the Actor log.",
            "default": false
          },
          "file": {
            "title": "Single image (alias)",
            "type": "string",
            "description": "Alias for a single image URL, kept so existing callers keep working."
          },
          "imageUrl": {
            "title": "Single image (0.1 alias)",
            "type": "string",
            "description": "Alias for a single image URL, kept so existing callers keep working."
          },
          "fileBase64": {
            "title": "Image as base64",
            "type": "string",
            "description": "Alternative to the file fields for API callers: the source encoded as base64."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}