{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk ChatGPT Alternative for CSV Rows: AI Classify, Tag, Enrich",
    "description": "Run one AI instruction on every row of a CSV, Google Sheet or Apify dataset and get each row back with its own columns plus the AI's: a label from your list, named fields pulled out, or written text. Use {column} names in the instruction. $0.0019 per row; failed and skipped rows are free.",
    "version": "1.0",
    "x-build-id": "fBDQp1KMpXVu0cKz7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bulkleads~ai-for-every-row-csv/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bulkleads-ai-for-every-row-csv",
        "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/bulkleads~ai-for-every-row-csv/runs": {
      "post": {
        "operationId": "runs-sync-bulkleads-ai-for-every-row-csv",
        "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/bulkleads~ai-for-every-row-csv/run-sync": {
      "post": {
        "operationId": "run-sync-bulkleads-ai-for-every-row-csv",
        "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",
        "required": [
          "instruction"
        ],
        "properties": {
          "rows": {
            "title": "Rows",
            "type": "array",
            "description": "Your table as a JSON list of rows, e.g. [{\"company\": \"Figma\", \"website\": \"figma.com\"}]. A plain text line becomes a row with one column, text. Or use a CSV / Google Sheets link or an Apify dataset below (all given are used, in this order)."
          },
          "csvUrl": {
            "title": "Or a CSV or Google Sheets link",
            "type": "string",
            "description": "A CSV file or a Google Sheet anyone with the link can open (the tab in the link is the one read). The header row names the columns."
          },
          "datasetId": {
            "title": "Or the rows of another run",
            "type": "string",
            "description": "A dataset from one of your runs, for example leads from Leads Finder or places from a Google Maps scraper."
          },
          "instruction": {
            "title": "Instruction for each row",
            "type": "string",
            "description": "What the AI does with each row. Put a column name in curly brackets where its value goes, e.g. \"Write a one-line opener for {first_name} at {company}\". With no {column}, the whole row is added under the instruction."
          },
          "mode": {
            "title": "What comes back",
            "enum": [
              "classify",
              "extract",
              "write"
            ],
            "type": "string",
            "description": "Classify: one label from your list per row. Extract: the fields you name, each as its own column (JSON). Write: free text, e.g. an opener, a summary or a translation.",
            "default": "write"
          },
          "labels": {
            "title": "Labels (classify)",
            "type": "array",
            "description": "The labels to choose from, one per line, at least two. Add \"Other\" so every row has one that fits. A row whose answer is not one of them comes back failed, free.",
            "items": {
              "type": "string"
            }
          },
          "fields": {
            "title": "Fields (extract)",
            "type": "array",
            "description": "The fields to pull out of each row, one per line, e.g. city, employees, founded_year. Each becomes its own column; anything the row does not say comes back null.",
            "items": {
              "type": "string"
            }
          },
          "outputColumn": {
            "title": "Output column name",
            "type": "string",
            "description": "The column the label or text goes in (classify and write). Empty: ai_label for classify, ai_text for write."
          },
          "systemPrompt": {
            "title": "System prompt",
            "type": "string",
            "description": "Instructions sent with every row (optional), e.g. \"You are a B2B researcher. Never invent facts.\""
          },
          "reasoning": {
            "title": "Reasoning effort",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "description": "How much the model thinks before answering. Low is fastest and cheapest; high is best for hard rows.",
            "default": "low"
          },
          "temperature": {
            "title": "Temperature",
            "minimum": 0,
            "maximum": 2,
            "type": "number",
            "description": "Empty: 0 for classify and extract (the same answer each time), 0.7 for write. Higher gives more varied text."
          },
          "maxTokens": {
            "title": "Max tokens per row",
            "minimum": 16,
            "maximum": 4096,
            "type": "integer",
            "description": "The longest answer, in tokens (about 0.75 words each), reasoning included.",
            "default": 1024
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Work on at most this many rows (optional)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}