{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Schema Web Extractor: BYOK + Browser Fallback",
    "description": "Extract schema-validated JSON from URLs with your own LLM key. Starts on fast HTTP and renders JavaScript only when the page needs it, with source evidence for the fields.",
    "version": "0.1",
    "x-build-id": "ulFxICH4PewmnynJd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automa-flow~ai-schema-web-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automa-flow-ai-schema-web-extractor",
        "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/automa-flow~ai-schema-web-extractor/runs": {
      "post": {
        "operationId": "runs-sync-automa-flow-ai-schema-web-extractor",
        "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/automa-flow~ai-schema-web-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-automa-flow-ai-schema-web-extractor",
        "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": [
          "urls",
          "schema",
          "llmProvider"
        ],
        "properties": {
          "urls": {
            "title": "URLs",
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "description": "1 to 500 public http or https pages you are allowed to process. Exact normalized duplicates are dropped. Localhost, private networks and file downloads are reported per URL.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^https?://\\S+$"
            }
          },
          "schema": {
            "title": "JSON Schema",
            "type": "object",
            "description": "JSON Schema for one object, or an array of objects. Draft 2020-12 and draft-07 only. Local $ref such as #/$defs/Price (Pydantic or Zod export) is inlined. Remote or recursive $ref and conditional keywords are rejected before any page is fetched."
          },
          "instructions": {
            "title": "Instructions",
            "maxLength": 2000,
            "type": "string",
            "description": "Optional note for the model, such as which product on the page to extract. Webpage text is never treated as instructions.",
            "default": ""
          },
          "llmProvider": {
            "title": "Model provider",
            "enum": [
              "openai",
              "anthropic"
            ],
            "type": "string",
            "description": "Bring your own key. openai and anthropic are the supported providers. An Anthropic key (sk-ant-...) or a Claude model uses anthropic, and an OpenAI key uses openai, whatever this field says. The Actor does not sell model tokens.",
            "default": "openai"
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your OpenAI or Anthropic key. Required when test mode is off, otherwise the run stops at startup with API_KEY_REQUIRED. Leave empty in test mode. The key is not stored, logged or written to the dataset."
          },
          "model": {
            "title": "Model",
            "pattern": "^(gpt-5\\.6-terra|gpt-5\\.6-luna|gpt-5\\.6-sol|claude-haiku-4-5|claude-sonnet-5)$",
            "maxLength": 64,
            "type": "string",
            "description": "Optional allowlisted model id. OpenAI defaults to gpt-5.6-terra. Anthropic defaults to claude-haiku-4-5. Arbitrary endpoint URLs are rejected."
          },
          "renderingMode": {
            "title": "Rendering",
            "enum": [
              "HTTP_ONLY",
              "AUTO",
              "BROWSER"
            ],
            "type": "string",
            "description": "AUTO fetches HTTP first and opens a browser only when the static page is too thin. HTTP_ONLY never renders. BROWSER renders every URL once, still without login or CAPTCHA bypass. BROWSER stops before fetch unless the charge limit covers at least $0.006.",
            "default": "AUTO"
          },
          "includeEvidence": {
            "title": "Include evidence",
            "type": "boolean",
            "description": "Ask the model for a source quote per extracted field and check that the quote appears in the page text. This is a presence check, not a confidence score.",
            "default": true
          },
          "maxInputChars": {
            "title": "Max input characters",
            "minimum": 2000,
            "maximum": 80000,
            "type": "integer",
            "description": "Maximum characters of cleaned page text sent to the model. Structured blocks are included first. The row records how many characters were sent.",
            "default": 40000
          },
          "testMode": {
            "title": "Test mode",
            "type": "boolean",
            "description": "On, the Actor returns a labeled non-live fixture for your schema and does not fetch pages or call a model. Turn this off for a live extraction.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}