{
  "openapi": "3.0.1",
  "info": {
    "title": "Jev Bulk Classifier (TypeSafe AI System One)",
    "description": "Bulk-classify texts or any Actor's dataset with TypeSafe AI's Jev: routing, sentiment, lead scoring and yes/no checks with calibrated confidence. Presets for Google Maps, LinkedIn, social media, reviews and job scrapers. Bring your own Jev key. $0.50 per 1,000 items.",
    "version": "0.0",
    "x-build-id": "pMBhkxoOvVcL5Agn8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sameh.jarour~jev-classifier/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sameh.jarour-jev-classifier",
        "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/sameh.jarour~jev-classifier/runs": {
      "post": {
        "operationId": "runs-sync-sameh.jarour-jev-classifier",
        "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/sameh.jarour~jev-classifier/run-sync": {
      "post": {
        "operationId": "run-sync-sameh.jarour-jev-classifier",
        "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": {
          "apiKey": {
            "title": "TypeSafe AI API key",
            "type": "string",
            "description": "Your TypeSafe AI (Jev) API key from <a href='https://console.typesafe.ai' target='_blank'>console.typesafe.ai</a>. Stored encrypted and never logged. You pay TypeSafe directly for Jev tokens. For local development you can omit it and set the <code>JEV_API_KEY</code> or <code>TYPESAFE_API_KEY</code> environment variable instead."
          },
          "items": {
            "title": "Items to classify",
            "type": "array",
            "description": "Texts or JSON objects to evaluate, one Jev call per item. Each item may be a plain string (e.g. a support message) or a JSON object/array (e.g. <code>{\"subject\": ..., \"body\": ...}</code>). Leave empty when you use <b>Dataset IDs</b> instead."
          },
          "datasetIds": {
            "title": "Dataset IDs",
            "type": "array",
            "description": "IDs or names of Apify datasets whose items should be classified, for example the default dataset of a Google Maps Scraper run. Items are processed after any inline <b>Items</b>. Each output row records the source dataset and offset so you can join results back.",
            "items": {
              "type": "string"
            }
          },
          "datasetFields": {
            "title": "Dataset fields to send",
            "type": "array",
            "description": "Only these fields of each dataset item are sent to Jev (dot notation such as <code>authorMeta.name</code> works). Strongly recommended for large records like Google Maps places: it cuts token cost and keeps Jev focused. Leave empty to send whole items. Items with none of the fields are skipped.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max dataset items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop loading dataset items after this many (across all datasets). 0 means no limit. Handy for testing questions on a sample before a full run.",
            "default": 0
          },
          "preset": {
            "title": "Question preset",
            "enum": [
              "custom",
              "support-tickets",
              "google-maps-reviews",
              "google-maps-leads",
              "linkedin-profiles",
              "company-enrichment",
              "social-media-posts",
              "social-media-comments",
              "product-reviews",
              "job-postings"
            ],
            "type": "string",
            "description": "Ready-made question sets for the outputs of popular scrapers. Pick one and you can leave <b>Questions</b> untouched; choose <i>Custom</i> to use your own questions below. See the README for what each preset asks and which dataset fields to send.",
            "default": "custom"
          },
          "questions": {
            "title": "Questions (custom preset)",
            "type": "object",
            "description": "Used when <b>Question preset</b> is <i>Custom</i>. Map of question id → Jev question, passed to the API verbatim. Types: <b>choice</b> (<code>criteria</code> = object mapping option label → description, up to 255 options), <b>score</b> (<code>criteria</code> = ordered array of 2–10 level descriptions), <b>noul</b> (yes/no; optional <code>criteria</code> with <code>true</code>/<code>false</code> descriptions)."
          },
          "model": {
            "title": "Model",
            "enum": [
              "jev-latest",
              "jev-preview",
              "jev-1.13.0"
            ],
            "type": "string",
            "description": "Jev model or alias. <code>jev-latest</code> is the stable release alias. Pin a versioned id if you have tuned confidence thresholds and want answers to stay stable across releases.",
            "default": "jev-latest"
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Number of items evaluated in parallel. Jev allows roughly 1,200 requests per minute; 10 is safe for most accounts. Raise it for large batches of short items.",
            "default": 10
          },
          "maxRetries": {
            "title": "Max retries per item",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Retries on rate limits (429), overload (529), other 5xx, timeouts and connection errors, with exponential backoff that honors Retry-After. Invalid key (401) and malformed requests (400/422) are never retried.",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Timeout per HTTP attempt. Typical Jev calls finish in well under a second; raise this only for very large items.",
            "default": 60
          },
          "failOnError": {
            "title": "Fail run on item error",
            "type": "boolean",
            "description": "If enabled, the first item that still fails after retries aborts the whole run. If disabled (default), the error is recorded in the item's <code>error</code> field and processing continues. An invalid API key always aborts the run.",
            "default": false
          },
          "includeRawResponse": {
            "title": "Include raw API response",
            "type": "boolean",
            "description": "Adds the complete Jev response as <code>rawResponse</code> on every dataset item, in addition to the normalized <code>results</code>, <code>confidence</code> and <code>answers</code> fields.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}