{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk AI Dataset Enricher – Run LLM Prompts on Every Row",
    "description": "Run an AI prompt on every row of an Apify dataset, CSV, Excel or JSON list: classify, tag sentiment, extract fields, summarize or translate with GPT, Gemini, Claude, Llama and 400+ models. No API key. $0.80 per 1,000 rows + LLM tokens.",
    "version": "0.1",
    "x-build-id": "urDDk5M7RLGA2ugTz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~bulk-ai-dataset-enricher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-bulk-ai-dataset-enricher",
        "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~bulk-ai-dataset-enricher/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-bulk-ai-dataset-enricher",
        "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~bulk-ai-dataset-enricher/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-bulk-ai-dataset-enricher",
        "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": {
          "datasetIds": {
            "title": "Apify datasets",
            "type": "array",
            "description": "Apify datasets to enrich, e.g. the output of a scraper run. In an integration use {{resource.defaultDatasetId}}. All sources (datasets, files, pasted rows) are combined. Remove the example pasted rows when you use your own data."
          },
          "fileUrls": {
            "title": "File URLs (CSV, XLSX, JSON)",
            "type": "array",
            "description": "Public URLs of CSV, TSV, XLSX, XLS, ODS, JSON or JSON Lines files. Google Sheets ('Anyone with the link'), Google Drive, Dropbox, OneDrive and GitHub links are converted to direct downloads.",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "title": "Or paste JSON rows",
            "type": "array",
            "description": "A JSON array of objects (one object = one row). Handy for quick tests and AI agents."
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many rows in total (0 = all rows). You pay per enriched row, so start small.",
            "default": 1000
          },
          "task": {
            "title": "Task",
            "enum": [
              "custom",
              "sentiment",
              "classify",
              "extract",
              "summarize",
              "translate"
            ],
            "type": "string",
            "description": "Custom = your prompt template decides everything. The presets add a tested instruction and fixed output columns; the prompt template is then just the text to process (empty = the whole row).",
            "default": "custom"
          },
          "prompt": {
            "title": "Prompt template",
            "type": "string",
            "description": "Use {{column}} placeholders, e.g. {{title}}, {{address.city}} (dot paths), {{row}} (the whole row as JSON). Missing columns become empty text. Rows whose placeholders are all empty are skipped for free."
          },
          "systemPrompt": {
            "title": "System prompt / extra instructions",
            "type": "string",
            "description": "Optional. Role, tone, language or rules, e.g. 'You are a B2B lead qualification expert. Answer in English.'"
          },
          "outputMode": {
            "title": "Output (custom task)",
            "enum": [
              "text",
              "json"
            ],
            "type": "string",
            "description": "Text = the answer goes into one column. JSON = the model must return the fields below, each saved as its own column.",
            "default": "text"
          },
          "outputColumn": {
            "title": "Text column name",
            "type": "string",
            "description": "Column for the answer in text mode.",
            "default": "aiOutput"
          },
          "outputFields": {
            "title": "Output fields (JSON mode / extract)",
            "type": "object",
            "description": "Field name -> description. Type is inferred: 'a|b|c' = one of these labels, 'number ...', 'integer ...', 'boolean ...', 'array ...' (list of strings), anything else = text. Full JSON-schema objects are accepted too."
          },
          "labels": {
            "title": "Category labels (classify)",
            "type": "array",
            "description": "For the Classify task: the allowed categories, e.g. Sales lead, Support request, Spam.",
            "items": {
              "type": "string"
            }
          },
          "targetLanguage": {
            "title": "Target language (translate)",
            "type": "string",
            "description": "For the Translate task.",
            "default": "English"
          },
          "summaryMaxWords": {
            "title": "Summary length (words)",
            "minimum": 5,
            "maximum": 500,
            "type": "integer",
            "description": "For the Summarize task.",
            "default": 40
          },
          "model": {
            "title": "Model",
            "enum": [
              "google/gemini-2.5-flash-lite",
              "openai/gpt-4.1-nano",
              "mistralai/mistral-small-3.2-24b-instruct",
              "meta-llama/llama-3.3-70b-instruct",
              "openai/gpt-4o-mini",
              "anthropic/claude-haiku-5.5",
              "google/gemini-2.5-flash",
              "deepseek/deepseek-v4.1-flash",
              "google/gemini-3.5-flash-lite",
              "openai/gpt-5.4-mini",
              "anthropic/claude-sonnet-5.5"
            ],
            "type": "string",
            "description": "LLM used through Apify's OpenRouter Actor. Prices are OpenRouter's per million input / output tokens, billed to your Apify account (Apify free plan: 10x). Most row tasks cost $0.00002-0.0002 per row with the default model.",
            "default": "google/gemini-2.5-flash-lite"
          },
          "customModel": {
            "title": "Custom OpenRouter model ID",
            "type": "string",
            "description": "Optional: any model ID from openrouter.ai/models (e.g. qwen/qwen3-235b-a22b-2507). Overrides the select above."
          },
          "temperature": {
            "title": "Temperature",
            "type": "string",
            "description": "0 = consistent answers (recommended for classification/extraction), up to 1 = more creative.",
            "default": "0"
          },
          "maxOutputTokens": {
            "title": "Max output tokens per row",
            "minimum": 16,
            "maximum": 2048,
            "type": "integer",
            "description": "Upper limit of the answer length (Apify's OpenRouter Actor caps it at 2,048).",
            "default": 512
          },
          "maxInputChars": {
            "title": "Max prompt characters per row",
            "minimum": 200,
            "maximum": 200000,
            "type": "integer",
            "description": "Longer rendered prompts are truncated, which keeps token costs predictable.",
            "default": 12000
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many rows are sent to the model at the same time. Rate limits are retried automatically.",
            "default": 10
          },
          "keepOriginalColumns": {
            "title": "Keep original columns",
            "type": "boolean",
            "description": "On = original row + AI columns. Off = only the columns listed below + AI columns.",
            "default": true
          },
          "keepColumns": {
            "title": "Columns to keep (when original columns are off)",
            "type": "array",
            "description": "E.g. id, url, name.",
            "items": {
              "type": "string"
            }
          },
          "includeUsage": {
            "title": "Add model and token columns",
            "type": "boolean",
            "description": "Adds aiModel and aiTokens to every row.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}