{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Dataset Enricher – Bulk LLM Prompt on Every Row",
    "description": "Run an AI prompt or a ready preset (review sentiment, comment intent, translation, entities, classification, summary) on every row of any Apify dataset or pasted JSON. Valid JSON per row, cost estimate first. Failed and empty rows are free; repeated rows cost less.",
    "version": "0.1",
    "x-build-id": "49Ndaq5IkrPYQgEe6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/smoxy~dataset-ai-refinery/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-smoxy-dataset-ai-refinery",
        "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/smoxy~dataset-ai-refinery/runs": {
      "post": {
        "operationId": "runs-sync-smoxy-dataset-ai-refinery",
        "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/smoxy~dataset-ai-refinery/run-sync": {
      "post": {
        "operationId": "run-sync-smoxy-dataset-ai-refinery",
        "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": {
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "The dataset whose rows are processed (the output of another Actor). Leave empty to use the pasted rows below. If both are given, the dataset is used."
          },
          "rows": {
            "title": "Rows (pasted JSON)",
            "type": "array",
            "description": "A list of objects, for example reviews or comments. Used when no dataset is given. Leave it empty, with no dataset, to run the free example: five static sample rows with the output of the sentiment preset, no model is called."
          },
          "textField": {
            "title": "Text field",
            "type": "string",
            "description": "Name of the field that holds the text to process. Leave empty to detect it automatically (text, reviewDescription, caption, comment, content and similar). A dotted name such as review.body reaches into objects."
          },
          "fieldsToKeep": {
            "title": "Fields to keep",
            "type": "array",
            "description": "The fields of the original row that are copied to the output. Leave empty to keep all of them.",
            "items": {
              "type": "string"
            }
          },
          "preset": {
            "title": "Preset",
            "enum": [
              "review-sentiment-aspects",
              "comment-intent",
              "translate",
              "entities",
              "classify",
              "summarize",
              "custom"
            ],
            "type": "string",
            "description": "What to do with every row. Choose custom, or clear this field, to use your own prompt."
          },
          "prompt": {
            "title": "Prompt",
            "type": "string",
            "description": "Your own instruction for every row (custom preset), or an extra instruction that refines a preset. Up to 4000 characters."
          },
          "outputSchema": {
            "title": "Output schema (custom)",
            "type": "object",
            "description": "JSON Schema of the answer for a custom prompt: an object with properties of type string, number, integer, boolean, array or object. All fields are required; use [\"string\",\"null\"] for an optional value. Without a schema the answer is {\"result\": \"...\"}."
          },
          "labels": {
            "title": "Labels (classify)",
            "type": "array",
            "description": "For the classify preset: the labels to choose from (2 to 50). Every row gets exactly one.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "For translate: the target language code (bg, ca, cs, da, de, el, en, es, et, fi, fr, ga, hr, hu, it, lt, lv, mt, nl, pl, pt, ro, sk, sl, sv). For the other presets: the language of the free-text values of the answer (default English)."
          },
          "qualityTier": {
            "title": "Quality",
            "enum": [
              "cheap",
              "quality"
            ],
            "type": "string",
            "description": "cheap uses a fast, low-cost model. quality uses a stronger model for a higher price per row.",
            "default": "cheap"
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound of rows processed in this run (up to 5000). Accounts without a paid plan are limited to 50 rows per run.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}