{
  "openapi": "3.0.1",
  "info": {
    "title": "ELYRAON Dataset Doctor — JSONL/CSV Fine-Tune Checker",
    "description": "Inspect JSONL and CSV instruction data before a fine-tune. Flags broken JSON, bad chat-role order, exact duplicates, PII counts, and CSV formula prefixes. Deterministic rules. No model calls.",
    "version": "1.2",
    "x-build-id": "E8OHymSFGPLbeCGuH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/colt2822~dataset-doctor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-colt2822-dataset-doctor",
        "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/colt2822~dataset-doctor/runs": {
      "post": {
        "operationId": "runs-sync-colt2822-dataset-doctor",
        "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/colt2822~dataset-doctor/run-sync": {
      "post": {
        "operationId": "run-sync-colt2822-dataset-doctor",
        "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": [
          "input_mode"
        ],
        "properties": {
          "input_mode": {
            "title": "Input Mode",
            "enum": [
              "sample",
              "text",
              "url"
            ],
            "type": "string",
            "description": "Where the data comes from. 'Synthetic sample' runs a built-in demo dataset (nothing of yours is processed). 'Inline text' uses Dataset Content. 'Remote file URL' downloads File URL. Provide only the field that matches the mode you choose; an empty or conflicting source fails the run with an error and processes nothing."
          },
          "sample_name": {
            "title": "Sample Dataset",
            "enum": [
              "alpaca_synthetic_dirty",
              "chatml_pii_leakage",
              "sharegpt_conversations_broken",
              "csv_injection_benchmark"
            ],
            "type": "string",
            "description": "Used only when Input Mode is 'Synthetic sample'. Ignored in other modes.",
            "default": "alpaca_synthetic_dirty"
          },
          "dataset_text": {
            "title": "Dataset Content (JSONL / CSV)",
            "type": "string",
            "description": "Used only when Input Mode is 'Inline text'. Paste raw JSONL or CSV (up to 5 MB). Must not be empty.",
            "default": ""
          },
          "file_url": {
            "title": "Remote Dataset File URL",
            "type": "string",
            "description": "Used only when Input Mode is 'Remote file URL'. A public http(s) link to a JSONL or CSV file of at most 5 MB. Localhost, private-network and link-local addresses, URLs with embedded credentials, and other schemes are rejected.",
            "default": ""
          },
          "detect_pii": {
            "title": "Detect PII and Credentials",
            "type": "boolean",
            "description": "Scan records for emails, phone numbers, SSNs, credit cards, IP addresses, and API key patterns. Results report only the type and the number of matches per record, never the matched values.",
            "default": true
          },
          "redact_pii": {
            "title": "Redact Detected PII",
            "type": "boolean",
            "description": "If enabled, replaces emails, phone numbers, SSNs, credit cards and API keys with [REDACTED_TYPE] tokens in the cleaned records. IP addresses are detected and counted but not redacted. If disabled, cleaned records contain your data unmodified.",
            "default": false
          },
          "deduplicate_exact": {
            "title": "Exact Deduplication",
            "type": "boolean",
            "description": "Detect and flag identical records using SHA-256 hashes.",
            "default": true
          },
          "deduplicate_near": {
            "title": "Near-Duplicate Detection (SimHash)",
            "type": "boolean",
            "description": "Detect near-identical records using 64-bit SimHash with Hamming distance threshold.",
            "default": false
          },
          "filter_low_info": {
            "title": "Filter Low-Information Records",
            "type": "boolean",
            "description": "Flag empty, whitespace-only, or repetitive boilerplate records below minimum informative length.",
            "default": true
          },
          "max_records": {
            "title": "Maximum Records to Process",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound on inspected records per job (bounded to 5,000 max for safety).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}