{
  "openapi": "3.0.1",
  "info": {
    "title": "P2M AI Feeder – PDF to Markdown Converter",
    "description": "Convert digital and scanned PDFs into clean Markdown, structured JSON, and deterministic chunks for AI agents and RAG pipelines. Supports OCR, tables, image descriptions, batch processing, and downloadable artifacts.",
    "version": "0.1",
    "x-build-id": "00Ay6FKjcKsPrivgc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gtgyani206~p2m-aifeeder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gtgyani206-p2m-aifeeder",
        "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/gtgyani206~p2m-aifeeder/runs": {
      "post": {
        "operationId": "runs-sync-gtgyani206-p2m-aifeeder",
        "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/gtgyani206~p2m-aifeeder/run-sync": {
      "post": {
        "operationId": "run-sync-gtgyani206-p2m-aifeeder",
        "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": {
          "sources": {
            "title": "PDF files or URLs",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "description": "Upload one or more PDFs, or provide publicly reachable HTTP(S) PDF URLs.",
            "items": {
              "type": "string"
            }
          },
          "doOcr": {
            "title": "Enable OCR",
            "type": "boolean",
            "description": "Use local EasyOCR for scanned pages and text inside sufficiently large bitmap images. CPU-intensive; enable it for scans or image-based text.",
            "default": false
          },
          "forceFullPageOcr": {
            "title": "Force full-page OCR",
            "type": "boolean",
            "description": "Replace the PDF text layer with OCR for every page. Enable only for scans or PDFs with a broken hidden text layer because it is slower and can reduce native-text accuracy.",
            "default": false
          },
          "describeImages": {
            "title": "Describe images",
            "type": "boolean",
            "description": "Use the bundled local SmolVLM model to turn photos, diagrams, figures, and charts into searchable Markdown descriptions. This is CPU-intensive and disabled by default. No external AI API is used.",
            "default": false
          },
          "imageDescriptionPrompt": {
            "title": "Image description instructions",
            "minLength": 1,
            "maxLength": 2000,
            "type": "string",
            "description": "Instructions for the local vision model. Ask for the visual details most useful to your downstream agent or RAG pipeline.",
            "default": "Describe the image for retrieval. Extract important readable text and explain the main visual structure. Do not guess."
          },
          "extractTables": {
            "title": "Extract table structure",
            "type": "boolean",
            "description": "Reconstruct table rows and columns. Disable this for plain-text documents or as a last-resort fallback when table analysis is too expensive.",
            "default": true
          },
          "tableMode": {
            "title": "Table extraction mode",
            "enum": [
              "fast",
              "accurate"
            ],
            "type": "string",
            "description": "Fast mode is the practical default. Accurate mode is slower and intended for complex tables.",
            "default": "fast"
          },
          "pageBatchSize": {
            "title": "Pages per conversion batch",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Convert and persist this many pages at a time. Smaller batches isolate slow pages and preserve more progress; larger batches have less overhead.",
            "default": 6
          },
          "chunkSizeChars": {
            "title": "Chunk size",
            "minimum": 1000,
            "maximum": 30000,
            "type": "integer",
            "description": "Approximate maximum number of characters per agent-ready chunk.",
            "default": 6000
          },
          "chunkOverlapChars": {
            "title": "Chunk overlap",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Approximate content overlap retained between adjacent chunks.",
            "default": 500
          },
          "includeMarkdownInDataset": {
            "title": "Include full Markdown in dataset",
            "type": "boolean",
            "description": "Embed full Markdown in document rows for small PDFs; the key-value-store copy is always created.",
            "default": false
          },
          "includeChunksInDataset": {
            "title": "Include chunks in dataset",
            "type": "boolean",
            "description": "Push one dataset row per chunk so agents can consume content directly.",
            "default": true
          },
          "exportDoclingJson": {
            "title": "Export structured Docling JSON",
            "type": "boolean",
            "description": "Build and store Docling's lossless document representation with layout and provenance metadata. Disabled by default to avoid serializing a large structure that many runs do not use.",
            "default": false
          },
          "maxDoclingJsonPages": {
            "title": "Maximum pages for Docling JSON",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Skip structured Docling JSON when a PDF exceeds this page count, even if exportDoclingJson is enabled. Markdown and chunks are still produced.",
            "default": 50
          },
          "maxPages": {
            "title": "Maximum pages per PDF",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Reject an individual PDF when its page count exceeds this limit.",
            "default": 250
          },
          "maxFileSizeMb": {
            "title": "Maximum file size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Reject an individual PDF when its downloaded size exceeds this limit.",
            "default": 50
          },
          "doclingTimeoutSeconds": {
            "title": "Docling batch timeout",
            "minimum": 30,
            "maximum": 3570,
            "type": "integer",
            "description": "Cooperative Docling processing limit for one page batch. Docling may return usable partial output when this limit is reached.",
            "default": 540
          },
          "workerTimeoutSeconds": {
            "title": "Hard worker batch timeout",
            "minimum": 60,
            "maximum": 3600,
            "type": "integer",
            "description": "Hard subprocess limit for one page batch. Must be at least 30 seconds greater than the Docling timeout so partial output has time to serialize.",
            "default": 600
          },
          "documentTimeoutSeconds": {
            "title": "Legacy hard timeout",
            "minimum": 60,
            "maximum": 3600,
            "type": "integer",
            "description": "Deprecated compatibility alias used only when workerTimeoutSeconds is absent. New inputs should use the separate Docling and worker batch timeouts."
          },
          "failFast": {
            "title": "Stop on first failure",
            "type": "boolean",
            "description": "When disabled, report a failed document and continue processing the remaining PDFs.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}