{
  "openapi": "3.0.1",
  "info": {
    "title": "Context Layer",
    "description": "Transforms documentation sites into a clean, structured context layer for AI systems—handling crawling, extraction, intelligent chunking, and optional enrichment for RAG, fine-tuning, and semantic search.",
    "version": "0.1",
    "x-build-id": "D5gbo1yh0VhKSrS45"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/evertools~context-layer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-evertools-context-layer",
        "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/evertools~context-layer/runs": {
      "post": {
        "operationId": "runs-sync-evertools-context-layer",
        "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/evertools~context-layer/run-sync": {
      "post": {
        "operationId": "run-sync-evertools-context-layer",
        "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": [
          "startUrl"
        ],
        "properties": {
          "startUrl": {
            "title": "Start URL",
            "type": "string",
            "description": "The URL of the knowledge base or documentation site to process"
          },
          "maxPages": {
            "title": "Max Pages",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of pages to crawl (0 = unlimited)",
            "default": 50
          },
          "crawlDepth": {
            "title": "Crawl Depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many links deep to follow from the start URL",
            "default": 3
          },
          "urlPatterns": {
            "title": "URL Patterns to Include",
            "type": "array",
            "description": "Only crawl URLs matching these patterns (glob format). Leave empty to crawl all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludePatterns": {
            "title": "URL Patterns to Exclude",
            "type": "array",
            "description": "Skip URLs matching these patterns",
            "default": [
              "**/changelog**",
              "**/blog**",
              "**/news**"
            ],
            "items": {
              "type": "string"
            }
          },
          "chunkSize": {
            "title": "Chunk Size (tokens)",
            "minimum": 0,
            "maximum": 8000,
            "type": "integer",
            "description": "Target size for each chunk in tokens. Set to 0 for auto-detection based on output format.",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk Overlap (tokens)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Number of overlapping tokens between chunks for context preservation",
            "default": 50
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "rag",
              "finetune-openai",
              "finetune-alpaca",
              "markdown"
            ],
            "type": "string",
            "description": "Format for the output data",
            "default": "rag"
          },
          "generateQA": {
            "title": "Generate Q&A Pairs",
            "type": "boolean",
            "description": "Generate question-answer pairs from each chunk. Great for fine-tuning datasets and improved RAG matching.",
            "default": false
          },
          "generateSummary": {
            "title": "Generate Summaries",
            "type": "boolean",
            "description": "Generate a brief summary of each chunk.",
            "default": false
          },
          "questionsPerChunk": {
            "title": "Questions Per Chunk",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many Q&A pairs to generate per chunk.",
            "default": 3
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "openai",
              "anthropic"
            ],
            "type": "string",
            "description": "Which AI provider to use for Q&A and summary generation.",
            "default": "openai"
          },
          "llmApiKey": {
            "title": "LLM API Key",
            "type": "string",
            "description": "Your API key for the selected LLM provider."
          },
          "generateEmbeddings": {
            "title": "Generate Embeddings",
            "type": "boolean",
            "description": "Generate vector embeddings for each chunk.",
            "default": false
          },
          "embeddingModel": {
            "title": "Embedding Model",
            "enum": [
              "text-embedding-3-small",
              "text-embedding-3-large",
              "text-embedding-ada-002"
            ],
            "type": "string",
            "description": "Which OpenAI embedding model to use.",
            "default": "text-embedding-3-small"
          },
          "embeddingApiKey": {
            "title": "Embedding API Key",
            "type": "string",
            "description": "Your OpenAI API key for generating embeddings."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}