{
  "openapi": "3.0.1",
  "info": {
    "title": "RAG Corpus Provenance Packager",
    "description": "Package rights-declared HTML, Markdown, text, and born-digital PDFs into deterministic RAG pages, traceable chunks, and verified manifests.",
    "version": "0.1",
    "x-build-id": "DAygFK4VN9vNtr5KY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/flintglade~rag-corpus-provenance-packager/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-flintglade-rag-corpus-provenance-packager",
        "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/flintglade~rag-corpus-provenance-packager/runs": {
      "post": {
        "operationId": "runs-sync-flintglade-rag-corpus-provenance-packager",
        "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/flintglade~rag-corpus-provenance-packager/run-sync": {
      "post": {
        "operationId": "run-sync-flintglade-rag-corpus-provenance-packager",
        "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": [
          "sources"
        ],
        "properties": {
          "inputSchemaVersion": {
            "title": "Input schema version",
            "minimum": 1,
            "maximum": 1,
            "type": "integer",
            "description": "Versioned runtime input contract.",
            "default": 1
          },
          "sources": {
            "title": "Explicit source documents",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "Each source selects one HTTPS URL or one user-authorized Apify KVS record and includes an explicit rights declaration. This declaration is recorded, not legally validated.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "url": {
                  "title": "Explicit HTTPS URL",
                  "type": "string",
                  "maxLength": 2048,
                  "description": "One public or user-authorized source; links are not followed."
                },
                "keyValueStoreId": {
                  "title": "Key-value store ID",
                  "type": "string",
                  "maxLength": 128,
                  "description": "A user-authorized Apify KVS selected instead of URL."
                },
                "recordKey": {
                  "title": "Record key",
                  "type": "string",
                  "maxLength": 256,
                  "description": "Exact record key in the selected KVS."
                },
                "rightsBasis": {
                  "title": "Required rights declaration",
                  "description": "Your declaration and evidence. This Actor does not provide legal advice or conclude that reuse is permitted.",
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "title": "Basis",
                      "description": "The user's declared basis for processing this source; metadata_only is recorded but cannot admit source text.",
                      "type": "string",
                      "enum": [
                        "user_owned",
                        "licensed",
                        "public_domain",
                        "open_license",
                        "metadata_only"
                      ]
                    },
                    "evidence": {
                      "title": "Evidence text",
                      "description": "Short non-secret evidence supporting the declaration.",
                      "type": "string",
                      "maxLength": 2000
                    },
                    "evidenceUrl": {
                      "title": "Evidence URL",
                      "description": "Optional HTTPS locator for evidence supporting the declaration.",
                      "type": "string",
                      "maxLength": 2048
                    }
                  },
                  "required": [
                    "type"
                  ]
                },
                "formatHint": {
                  "title": "Format hint",
                  "description": "Optional parser selection when source metadata or file extension is insufficient.",
                  "type": "string",
                  "enum": [
                    "html",
                    "markdown",
                    "text",
                    "pdf"
                  ]
                },
                "includeSelectors": {
                  "title": "HTML include selectors",
                  "description": "Optional bounded CSS selectors identifying HTML regions to include.",
                  "type": "array",
                  "editor": "stringList",
                  "maxItems": 20,
                  "items": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "excludeSelectors": {
                  "title": "HTML exclude selectors",
                  "description": "Optional bounded CSS selectors identifying HTML regions to remove.",
                  "type": "array",
                  "editor": "stringList",
                  "maxItems": 20,
                  "items": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              },
              "required": [
                "rightsBasis"
              ]
            }
          },
          "chunking": {
            "title": "Deterministic chunking",
            "type": "object",
            "description": "Character chunking with a stable version, size, and overlap.",
            "properties": {
              "strategy": {
                "title": "Strategy",
                "description": "Version 1 supports deterministic character chunking only.",
                "type": "string",
                "enum": [
                  "character"
                ],
                "default": "character"
              },
              "size": {
                "title": "Chunk size",
                "description": "Maximum characters per chunk.",
                "type": "integer",
                "minimum": 200,
                "maximum": 5000,
                "default": 1000
              },
              "overlap": {
                "title": "Chunk overlap",
                "description": "Characters repeated between adjacent chunks; runtime requires less than size.",
                "type": "integer",
                "minimum": 0,
                "maximum": 4999,
                "default": 150
              }
            },
            "default": {
              "strategy": "character",
              "size": 1000,
              "overlap": 150
            },
            "additionalProperties": false
          },
          "dedupe": {
            "title": "Deduplication",
            "type": "object",
            "description": "Version 1 performs exact canonical-content deduplication only.",
            "properties": {
              "mode": {
                "title": "Mode",
                "description": "Exact hashing preserves similar-but-distinct documents.",
                "type": "string",
                "enum": [
                  "exact"
                ],
                "default": "exact"
              }
            },
            "default": {
              "mode": "exact"
            },
            "additionalProperties": false
          },
          "baselineStoreId": {
            "title": "Baseline KVS",
            "type": "string",
            "description": "Optional existing KVS for page invalidation history. State commits only after a paid event is accepted."
          },
          "retainRaw": {
            "title": "Retain raw source bytes",
            "type": "boolean",
            "description": "Store user-authorized raw bytes in KVS and the ZIP. Off by default.",
            "default": false
          },
          "maxBytesPerSource": {
            "title": "Maximum bytes per source",
            "minimum": 1,
            "maximum": 50000000,
            "type": "integer",
            "description": "Reject a source before parsing when its response exceeds this byte limit.",
            "default": 20000000
          },
          "concurrency": {
            "title": "Source-read concurrency",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Maximum simultaneous source reads, reduced automatically by the remaining event budget.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}