{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Multimodal Analyzer — powered by Gemini",
    "description": "Summarize, extract to your JSON schema, classify or compare web pages, PDFs, images, audio, video, YouTube links and any Apify dataset with Google Gemini. Bring your own Gemini API key. Token and cost estimate on every row. Not affiliated with Google.",
    "version": "0.1",
    "x-build-id": "Ut5o3ScnU16D2hzQj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/badr_xba~ai-multimodal-analyzer-gemini/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-badr_xba-ai-multimodal-analyzer-gemini",
        "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/badr_xba~ai-multimodal-analyzer-gemini/runs": {
      "post": {
        "operationId": "runs-sync-badr_xba-ai-multimodal-analyzer-gemini",
        "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/badr_xba~ai-multimodal-analyzer-gemini/run-sync": {
      "post": {
        "operationId": "run-sync-badr_xba-ai-multimodal-analyzer-gemini",
        "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": {
          "task": {
            "title": "Task",
            "enum": [
              "summarize",
              "extract",
              "classify",
              "analyze",
              "detect_key_info",
              "compare",
              "report",
              "custom"
            ],
            "type": "string",
            "description": "What Gemini does with each item. summarize: summary + key points. extract: structured JSON (use \"Output schema\"). classify: one or several of your labels, each with a model-reported confidence and the quote it is based on. analyze: themes, sentiment with evidence, strengths, weaknesses, recommendations. detect_key_info: dates, deadlines, amounts, contacts, obligations, risks. compare: every item, then one extra row comparing them. report: executive summary + sections. custom: your own instructions.",
            "default": "summarize"
          },
          "instructions": {
            "title": "Instructions (optional)",
            "type": "string",
            "description": "Extra guidance for every item, e.g. \"Focus on pricing and delivery terms\" or, for task custom, the full instruction. Content of the pages and files is treated as data: instructions hidden in them are not followed."
          },
          "outputSchema": {
            "title": "Output schema (task extract)",
            "type": "object",
            "description": "JSON Schema of the fields to extract (root must be \"type\": \"object\" with \"properties\"). Gemini enforces it (structured output). Supported keywords: type, properties, required, items, enum, description, format, minimum, maximum, minItems, maxItems, anyOf, $ref/$defs. Checked before the run starts."
          },
          "labels": {
            "title": "Labels (task classify)",
            "type": "array",
            "description": "The only labels Gemini may use, e.g. positive, negative, neutral. At least 2.",
            "items": {
              "type": "string"
            }
          },
          "multiLabel": {
            "title": "Allow several labels per item",
            "type": "boolean",
            "description": "Off: exactly one label per item. On: every label that applies.",
            "default": false
          },
          "language": {
            "title": "Output language",
            "type": "string",
            "description": "\"auto\" answers in the language of each item; or any language name, e.g. English, French.",
            "default": "auto"
          },
          "startUrls": {
            "title": "Web pages",
            "type": "array",
            "description": "Pages to read (plain HTTP request, robots.txt respected, no JavaScript rendering). A PDF or image URL is read as a document or image; a YouTube link as a video.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "texts": {
            "title": "Texts",
            "type": "array",
            "description": "Raw texts, one item per entry (emails, reviews, transcripts…).",
            "items": {
              "type": "string"
            }
          },
          "documentUrls": {
            "title": "Document URLs",
            "type": "array",
            "description": "PDF (read natively by Gemini, including scans, tables and charts; up to 50 MB), DOCX, TXT, MD or CSV.",
            "items": {
              "type": "string"
            }
          },
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "PNG, JPEG, WEBP, HEIC, GIF images (up to 15 MB each): screenshots, product photos, receipts, charts.",
            "items": {
              "type": "string"
            }
          },
          "mediaUrls": {
            "title": "Audio / video URLs and YouTube links",
            "type": "array",
            "description": "Audio (MP3, WAV, AAC, OGG, FLAC, M4A…) or video files (MP4, MOV, WEBM…) up to 200 MB, and PUBLIC YouTube videos (Google's YouTube input is a preview feature). Files above 19 MB are sent through the Gemini Files API and deleted after the run.",
            "items": {
              "type": "string"
            }
          },
          "datasetIds": {
            "title": "Apify dataset IDs",
            "type": "array",
            "description": "Analyse the results of any other Apify Actor: one item per dataset row (e.g. reviews, posts, product pages scraped by another Actor).",
            "items": {
              "type": "string"
            }
          },
          "datasetFields": {
            "title": "Dataset fields to read",
            "type": "array",
            "description": "Field names (dotted paths allowed, e.g. author.name) sent to Gemini. Empty: the usual text fields (text, markdown, description, title, review…), else every short field.",
            "items": {
              "type": "string"
            }
          },
          "maxDatasetItems": {
            "title": "Max rows per dataset",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Rows read from each dataset.",
            "default": 100
          },
          "analysisLevel": {
            "title": "Analysis level",
            "enum": [
              "quick",
              "standard",
              "deep"
            ],
            "type": "string",
            "description": "quick: gemini-3.5-flash-lite (cheapest, minimal thinking). standard: gemini-3.8-flash with low thinking (own key: an item it cannot answer - no response, HTTP 503/429 - is retried once on gemini-3.6-flash). deep: gemini-4-argon with high thinking (flagship; Google doubles its price on 2026-12-01). Prices in the README.",
            "default": "standard"
          },
          "model": {
            "title": "Model override (optional)",
            "enum": [
              "gemini-3.5-flash-lite",
              "gemini-3.1-flash-lite",
              "gemini-3.8-flash",
              "gemini-3.6-flash",
              "gemini-4-argon",
              "gemini-3.1-pro-preview"
            ],
            "type": "string",
            "description": "Use a specific model instead of the level's default."
          },
          "estimateOnly": {
            "title": "Estimate only (no AI call)",
            "type": "boolean",
            "description": "Counts tokens and estimates the cost per item and in total; nothing is analysed and no AI usage is billed.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Items analysed in this run (all sources together).",
            "default": 50
          },
          "maxInputTokensPerItem": {
            "title": "Max input tokens per item",
            "minimum": 1000,
            "maximum": 800000,
            "type": "integer",
            "description": "Longer texts and PDFs are split into parts, read one by one and combined (map-reduce). Never cut silently: if parts are left out, the row says truncated: true with the reason.",
            "default": 100000
          },
          "maxOutputTokensPerItem": {
            "title": "Max output tokens per item",
            "minimum": 256,
            "maximum": 65536,
            "type": "integer",
            "description": "Includes the model's thinking tokens (Google bills them as output). Empty: the level's default (2,048 / 4,096 / 16,384)."
          },
          "maxTotalTokens": {
            "title": "Max total tokens (run)",
            "minimum": 0,
            "type": "integer",
            "description": "The run stops before a call that could go above this (0 = no limit; managed key: at most 2,000,000).",
            "default": 0
          },
          "maxCostUsd": {
            "title": "Max estimated AI cost (USD, run)",
            "type": "string",
            "description": "Stops before a call that could exceed this estimate at Google's list price, e.g. 1.50. Empty = no limit."
          },
          "maxChunksPerItem": {
            "title": "Max parts per item",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Upper bound on the parts of one long item (each part is one AI call).",
            "default": 12
          },
          "videoClipSeconds": {
            "title": "Video: seconds read",
            "minimum": 10,
            "maximum": 10800,
            "type": "integer",
            "description": "Only the first N seconds of each video (file or YouTube) are sent. Budgeted at 300 tokens per second (Google: about 100/s at default resolution, 300/s at high), so the default 300 s fits the default 100,000-token item limit.",
            "default": 300
          },
          "mediaResolution": {
            "title": "Image / video resolution",
            "enum": [
              "default",
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "description": "Lower resolution = fewer tokens; high helps with small print.",
            "default": "default"
          },
          "useUrlContext": {
            "title": "Let Gemini open the URLs mentioned in the content (URL context)",
            "type": "boolean",
            "description": "Free tool from Google; the retrieved pages are billed as input tokens. Off by default.",
            "default": false
          },
          "useContextCache": {
            "title": "Context cache for long shared instructions",
            "type": "boolean",
            "description": "When your instructions + schema exceed 4,096 tokens and there are 3+ items, they are cached once (Gemini explicit caching) instead of being re-sent. Gemini also caches repeated prefixes implicitly.",
            "default": true
          },
          "concurrency": {
            "title": "Parallel items",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many items are analysed at the same time. Lower it if your Gemini key hits rate limits.",
            "default": 3
          },
          "itemTimeoutSecs": {
            "title": "Timeout per AI call (s)",
            "minimum": 30,
            "maximum": 1800,
            "type": "integer",
            "description": "Maximum time for one Gemini call. It is raised automatically (with a warning) when the output limit needs more time.",
            "default": 300
          },
          "firstResponseTimeoutSecs": {
            "title": "Time to first response (s)",
            "minimum": 15,
            "maximum": 600,
            "type": "integer",
            "description": "If Gemini sends nothing at all (no text, no thinking, no usage) within this time, the call is aborted and retried once (no retry when a level fallback model is available: the item goes to it at once); the item then fails with code providerNoResponse. After 2 such no-responses in a row on the same model, the remaining items are skipped instead of waiting again. Calls that are streaming data keep the full timeout above.",
            "default": 60
          },
          "apiKeyMode": {
            "title": "API key",
            "enum": [
              "own_key",
              "managed"
            ],
            "type": "string",
            "description": "own_key: your Gemini API key (Google AI Studio), AI cost on your Google account, small flat fee per item here. managed: no key needed, billed per 1,000 tokens (paid Apify plans only).",
            "default": "own_key"
          },
          "apiKey": {
            "title": "Gemini API key",
            "type": "string",
            "description": "From aistudio.google.com/apikey. Stored encrypted by Apify, never logged. Without a key, the run only estimates tokens and cost."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}