{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Filter & Rank Any Dataset",
    "description": "Semantic filtering and ranking with source-grounded AI evidence. ChevetAI Qwen is primary, with a DeepSeek fallback when needed; unsupported or incomplete required AI work fails without success output.",
    "version": "1.0",
    "x-build-id": "PsmHucXaGaDsntDIt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/oscar.smith-owner~chevet-semantic-filter-ranker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-oscar.smith-owner-chevet-semantic-filter-ranker",
        "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/oscar.smith-owner~chevet-semantic-filter-ranker/runs": {
      "post": {
        "operationId": "runs-sync-oscar.smith-owner-chevet-semantic-filter-ranker",
        "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/oscar.smith-owner~chevet-semantic-filter-ranker/run-sync": {
      "post": {
        "operationId": "run-sync-oscar.smith-owner-chevet-semantic-filter-ranker",
        "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": [
          "criteria"
        ],
        "properties": {
          "sourceDataset": {
            "title": "Source Dataset",
            "minLength": 1,
            "type": "string",
            "description": "Existing Apify dataset ID or name to filter and rank. The Actor reads the selected dataset only."
          },
          "criteria": {
            "title": "What are you looking for? (Natural Language Criteria)",
            "minLength": 5,
            "type": "string",
            "description": "Describe what you want to filter and rank in plain English. Include target attributes, hard exclusions, and preference ranking signals."
          },
          "minScore": {
            "title": "Minimum Match Score (0–100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum semantic score required to classify a record as a match.",
            "default": 65
          },
          "topK": {
            "title": "Maximum Results (Top-K)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Optional maximum number of top-ranking matches to return. If omitted, returns all records matching minScore."
          },
          "inlineItems": {
            "title": "Inline Items (Alternative to Dataset)",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "Optional array of JSON objects (up to 100 items) to filter and rank directly without needing an Apify dataset ID. The 20-record prefilled example is a runnable Store health-check sample; replace it with your own records or clear this field and provide a Source Dataset.",
            "items": {
              "type": "object"
            }
          },
          "fields": {
            "title": "Target Fields to Analyze (Optional)",
            "type": "array",
            "description": "Optional list of JSON paths (e.g. ['$.name', '$.description', '$.website']) to focus analysis on. Leave empty for automatic relevant-field selection.",
            "items": {
              "type": "string"
            }
          },
          "includeOriginalRecord": {
            "title": "Include Original Record",
            "type": "boolean",
            "description": "When enabled, the full original source JSON object is preserved under the 'item' property of each output result.",
            "default": true
          },
          "includeRejected": {
            "title": "Include Rejected & Uncertain Items",
            "type": "boolean",
            "description": "When enabled, rejected (non-match) and uncertain items are also written to the dataset for diagnostic and audit purposes.",
            "default": false
          },
          "maxItems": {
            "title": "Max Source Items to Process",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of source dataset items to read and evaluate.",
            "default": 10000
          },
          "startOffset": {
            "title": "Start Offset",
            "minimum": 0,
            "type": "integer",
            "description": "Number of source items to skip from the beginning of the dataset.",
            "default": 0
          },
          "qualityMode": {
            "title": "Quality Mode",
            "enum": [
              "high_quality",
              "fast"
            ],
            "type": "string",
            "description": "High quality enables two-pass ambiguity reviews and global listwise candidate reranking. Fast mode runs single-pass evaluation.",
            "default": "fast"
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Number of parallel AI evaluation requests (default: 8, max: 16).",
            "default": 8
          },
          "maxAiCalls": {
            "title": "Maximum AI Calls",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum total Chevet and OpenRouter calls for this run, including reviews, repairs, adjudication, and reranking.",
            "default": 500
          },
          "maxAiTokens": {
            "title": "Maximum AI Tokens",
            "minimum": 1000,
            "maximum": 8000000,
            "type": "integer",
            "description": "Maximum combined provider input and output tokens for this run. Reaching this limit returns a clearly labelled partial result when valid records exist.",
            "default": 2000000
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}