{
  "openapi": "3.0.1",
  "info": {
    "title": "Base64 Encoder & Decoder – Image, PDF & File to Base64",
    "description": "Convert files, images, PDFs and text to Base64, base64url or data URI, and decode Base64 back to files or text. Bulk URLs, Dropbox/Drive links, MIME detection, optional image resize for LLM vision payloads. $0.80 per 1,000 files.",
    "version": "0.1",
    "x-build-id": "fJaSUCuaG1FvywvF7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~base64-file-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-base64-file-converter",
        "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/gazidev~base64-file-converter/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-base64-file-converter",
        "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/gazidev~base64-file-converter/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-base64-file-converter",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "encode",
              "decode"
            ],
            "type": "string",
            "description": "Encode turns files or text into Base64. Decode turns Base64 strings or data URIs back into files or text.",
            "default": "encode"
          },
          "fileUrls": {
            "title": "File URLs (encode)",
            "type": "array",
            "description": "Direct links to any file: images, PDFs, documents, audio. Dropbox, Google Drive and GitHub share links are converted to direct downloads. Social/video platforms are not supported.",
            "items": {
              "type": "string"
            }
          },
          "texts": {
            "title": "Texts (encode)",
            "type": "array",
            "description": "Plain text strings to encode (UTF-8).",
            "items": {
              "type": "string"
            }
          },
          "base64Inputs": {
            "title": "Base64 strings or data URIs (decode)",
            "type": "array",
            "description": "Standard Base64, base64url (with or without padding) or data URIs such as data:image/png;base64,iVBOR... Line breaks and spaces are ignored.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format (encode)",
            "enum": [
              "base64",
              "base64url",
              "dataUri"
            ],
            "type": "string",
            "description": "Data URIs include the detected MIME type and can be pasted into HTML, CSS, JSON or LLM vision APIs.",
            "default": "base64"
          },
          "decodeOutput": {
            "title": "Decoded output (decode)",
            "enum": [
              "auto",
              "file",
              "text"
            ],
            "type": "string",
            "description": "Decoded files are saved in the key-value store with a download link in the row.",
            "default": "auto"
          },
          "resizeMaxPx": {
            "title": "Resize images to max side (px)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "0 = keep the original size. Example: 1024 shrinks large photos before encoding, which keeps LLM vision payloads small. SVG and GIF are never resized.",
            "default": 0
          },
          "imageFormat": {
            "title": "Re-encode images as",
            "enum": [
              "keep",
              "jpeg",
              "png",
              "webp"
            ],
            "type": "string",
            "description": "Only used when resizing or when a format other than 'keep' is chosen.",
            "default": "keep"
          },
          "imageQuality": {
            "title": "JPEG/WebP quality",
            "minimum": 30,
            "maximum": 100,
            "type": "integer",
            "description": "Quality for JPEG and WebP output (30-100).",
            "default": 85
          },
          "inlineMaxKb": {
            "title": "Max inline output (KB)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Outputs up to this size are returned inside the dataset row (field 'output'). Larger outputs are saved as a .txt record in the key-value store and the row gets a 'fileUrl'.",
            "default": 256
          },
          "alwaysSaveFile": {
            "title": "Always save output as a file too",
            "type": "boolean",
            "description": "Also save small outputs to the key-value store.",
            "default": false
          },
          "lineLength": {
            "title": "Wrap Base64 lines at (characters)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "0 = one line. 76 gives MIME / email style lines. Only for standard Base64.",
            "default": 0
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped with a free error row.",
            "default": 25
          },
          "rejectHtml": {
            "title": "Skip web pages (HTML)",
            "type": "boolean",
            "description": "When a URL returns an HTML page instead of a file (for example a private share link), return a free error row instead of encoding the page.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}