{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Document Summarizer and Field Extractor",
    "description": "Summarize web pages and text and extract typed fields like prices, dates and skills as JSON, using your own OpenAI-compatible API key.",
    "version": "0.2",
    "x-build-id": "MoI8Tt9tae4S6xZdN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sorrel_flint~ai-doc-extract/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sorrel_flint-ai-doc-extract",
        "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/sorrel_flint~ai-doc-extract/runs": {
      "post": {
        "operationId": "runs-sync-sorrel_flint-ai-doc-extract",
        "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/sorrel_flint~ai-doc-extract/run-sync": {
      "post": {
        "operationId": "run-sync-sorrel_flint-ai-doc-extract",
        "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": {
          "urls": {
            "title": "Page URLs",
            "type": "array",
            "description": "Web pages to summarize, one document per URL (no crawling). robots.txt is respected and only public addresses are fetched; skipped URLs are listed in the ISSUES record and never charged.",
            "items": {
              "type": "string"
            }
          },
          "documents": {
            "title": "Inline documents",
            "type": "array",
            "description": "Documents supplied as text instead of URLs. Each item is an object with a 'name' and a 'text' field."
          },
          "fields": {
            "title": "Fields to extract",
            "maxItems": 30,
            "type": "array",
            "description": "Structured fields to pull out of every document, at most 30. Each item is an object: {\"name\": \"price\", \"type\": \"number\", \"description\": \"asking price in EUR\"} (description at most 120 characters). Types: string, number, boolean, string[]. Leave empty to get only a summary."
          },
          "instructions": {
            "title": "Instructions",
            "maxLength": 500,
            "type": "string",
            "description": "What the summary should focus on (at most 500 characters). Leave empty for a neutral summary of the whole document.",
            "default": ""
          },
          "summaryLength": {
            "title": "Summary length",
            "enum": [
              "short",
              "medium",
              "long",
              "none"
            ],
            "type": "string",
            "description": "How long the summary should be.",
            "default": "medium"
          },
          "outputLanguage": {
            "title": "Output language",
            "maxLength": 40,
            "type": "string",
            "description": "Language of the summary, for example 'English' or 'Danish'. Leave empty to keep the language of the document.",
            "default": ""
          },
          "openaiApiKey": {
            "title": "Your OpenAI-compatible API key",
            "type": "string",
            "description": "Your OpenAI key, or a key for any OpenAI-compatible service (set its URL below). Your provider bills you for the model directly; this Actor charges 0.01 USD per processed document. Without a key the run is a preview of the first 3 documents with placeholder values, which costs only the 0.005 USD start fee. Stored encrypted, never written to the output or log."
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "A model your key can use and that can answer in JSON. OpenAI: gpt-4o-mini (fast, cheap) or gpt-4o. OpenRouter: its ids, for example openai/gpt-4o-mini.",
            "default": "gpt-4o-mini"
          },
          "openaiBaseUrl": {
            "title": "OpenAI-compatible base URL (optional)",
            "type": "string",
            "description": "Leave empty for OpenAI. For another OpenAI-compatible service, its Chat Completions base URL, for example https://openrouter.ai/api/v1.",
            "default": ""
          },
          "maxCharsPerDocument": {
            "title": "Max characters per document",
            "minimum": 1000,
            "maximum": 400000,
            "type": "integer",
            "description": "Text beyond this many characters is cut off (the row says truncated: true). Long documents are processed in parts and the part results are merged; longer documents mean more model calls on your provider's bill.",
            "default": 40000
          },
          "testMode": {
            "title": "Test mode (free, no model call)",
            "type": "boolean",
            "description": "Run the whole pipeline on up to 10 documents with placeholder values instead of a model call; no document is charged. Use it to check your field definitions first. Runs without a key are a preview like this automatically (first 3 documents).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}