{
  "openapi": "3.0.1",
  "info": {
    "title": "image-rehoster",
    "description": "Re-host any image at a stable, public Apify URL. Provide a URL or base64 data and get back a permanent retrieval link. Supports JPEG, PNG, WebP, GIF, AVIF, SVG, and more. Up to 50 MB per image.",
    "version": "0.3",
    "x-build-id": "eFaq9k1PBjwYgfhI9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nativefoundation-inc~image-rehoster/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nativefoundation-inc-image-rehoster",
        "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/nativefoundation-inc~image-rehoster/runs": {
      "post": {
        "operationId": "runs-sync-nativefoundation-inc-image-rehoster",
        "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/nativefoundation-inc~image-rehoster/run-sync": {
      "post": {
        "operationId": "run-sync-nativefoundation-inc-image-rehoster",
        "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": {
          "imageUrl": {
            "title": "Image URL",
            "pattern": "^https?://.+",
            "type": "string",
            "description": "Direct URL of the image to download and host. Must resolve to a binary image file — not an HTML page, not a redirect to a login screen. HTTP and HTTPS supported. Up to 5 redirects are followed automatically. Maximum file size: 50 MB. The file extension from the URL path is preserved in storage (falls back to .png if none detected). Supported formats: JPEG, PNG, GIF, WebP, AVIF, SVG, BMP, TIFF, ICO, and any other binary image format. Provide this OR imageBase64 — never both; if both are sent, imageUrl wins. Example: 'https://example.com/assets/hero.jpg'"
          },
          "imageBase64": {
            "title": "Image (base64)",
            "type": "string",
            "description": "Base64-encoded image data, as an alternative to imageUrl — use this to send a PNG/JPEG/etc. directly without a public URL. Accepts a data URI (e.g. 'data:image/png;base64,iVBORw0...'), whose declared type sets the stored file extension, or raw base64 (stored as .png). Maximum decoded size: 50 MB. Provide this OR imageUrl — never both; if both are sent, imageUrl takes precedence and this is ignored."
          },
          "filename": {
            "title": "Filename (optional stem)",
            "type": "string",
            "description": "Optional filename stem for the stored image. Do NOT include a file extension — it is appended automatically (from imageUrl, or from the base64 data URI's type). If omitted, a random UUID v4 is used as the stem. Use a filename when you need a predictable, human-readable key or want to overwrite a previously stored image with the same key (within the same store). Example: 'product-hero' → stored as 'product-hero.jpg'. Spaces and unsupported characters are replaced with hyphens."
          },
          "permanentUrl": {
            "title": "Permanent URL",
            "type": "boolean",
            "description": "ON by default: the image is stored in a NAMED Key-Value Store, so the retrieval URL is permanent and never expires (re-running with the same filename updates the same URL). TRADE-OFF: a named store is never auto-cleaned, so you (the store owner) are billed for its storage for as long as it exists, and every read of its public URLs is billed to your account with no expiry cap. Turn OFF for a temporary URL that auto-deletes with your Apify plan's data-retention window (approx. 7–30 days, depending on your plan) at no ongoing cost. NOTE: Free-plan accounts may not have publicly accessible named stores — if the actor detects this, it will fail with a clear error. Either upgrade to a paid plan or turn this OFF to use temporary URLs instead.",
            "default": true
          },
          "storeName": {
            "title": "Store name (for permanent URLs)",
            "type": "string",
            "description": "Which named Key-Value Store to write to when Permanent URL is on. Defaults to 'hosted-images'; override to group images into a different store (e.g. per client or project). Ignored when Permanent URL is off.",
            "default": "hosted-images"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}