{
  "openapi": "3.0.1",
  "info": {
    "title": "Codebase Intelligence Pack",
    "description": "Analyze any GitHub repo or ZIP archive and produce 11 AI-ready intelligence files: architecture, API routes, auth patterns, DB schema, env vars, unused files, tech stack, and more.",
    "version": "1.0",
    "x-build-id": "DwICh2qGad4yeu4IU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wheat_tourist~codebase-intelligence-pack/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wheat_tourist-codebase-intelligence-pack",
        "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/wheat_tourist~codebase-intelligence-pack/runs": {
      "post": {
        "operationId": "runs-sync-wheat_tourist-codebase-intelligence-pack",
        "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/wheat_tourist~codebase-intelligence-pack/run-sync": {
      "post": {
        "operationId": "run-sync-wheat_tourist-codebase-intelligence-pack",
        "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": [
          "sourceType"
        ],
        "properties": {
          "sourceType": {
            "title": "Source Type",
            "enum": [
              "github",
              "zipUrl",
              "uploadedZip"
            ],
            "type": "string",
            "description": "Where to load the repository from.",
            "default": "github"
          },
          "githubUrl": {
            "title": "GitHub Repository URL",
            "type": "string",
            "description": "Full URL to the GitHub repository. E.g. https://github.com/expressjs/express",
            "default": "https://github.com/expressjs/express"
          },
          "githubToken": {
            "title": "GitHub Token (optional)",
            "type": "string",
            "description": "Personal Access Token (classic) or fine-grained org token with `repo:read` scope. Required for private repositories. Both personal PAT and organization-level tokens are supported."
          },
          "branch": {
            "title": "Branch / Tag / Commit SHA",
            "type": "string",
            "description": "Branch, tag, or commit SHA to analyze. Defaults to the repository's default branch."
          },
          "zipUrl": {
            "title": "ZIP Archive URL",
            "type": "string",
            "description": "Direct URL to a ZIP archive of the repository. Must be publicly accessible."
          },
          "uploadedZipKey": {
            "title": "Uploaded ZIP — KV Store Key",
            "type": "string",
            "description": "Key in the Actor's default Key-Value Store where the ZIP was pre-uploaded. See README for upload instructions."
          },
          "maxFileSizeKb": {
            "title": "Max File Size (KB)",
            "minimum": 1,
            "maximum": 10240,
            "type": "integer",
            "description": "Files larger than this will be skipped. Default: 500 KB.",
            "default": 500
          },
          "maxFiles": {
            "title": "Max Files to Analyze",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on total number of files to process. Default: 10000.",
            "default": 10000
          },
          "includePatterns": {
            "title": "Include Glob Patterns",
            "type": "array",
            "description": "Only analyze files matching these glob patterns. If empty, all files are included.",
            "items": {
              "type": "string"
            }
          },
          "excludePatterns": {
            "title": "Exclude Glob Patterns",
            "type": "array",
            "description": "Skip files matching these patterns. Common directories (node_modules, .git, __pycache__) are always excluded.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "all",
              "json-only",
              "markdown-only"
            ],
            "type": "string",
            "description": "Which output files to generate.",
            "default": "all"
          },
          "llmProvider": {
            "title": "LLM Provider (optional — for AI-enriched summaries)",
            "enum": [
              "",
              "openai",
              "google",
              "anthropic"
            ],
            "type": "string",
            "description": "When set, folder-summary.md and code-map.md include AI-generated natural language descriptions. Leave empty for pure static analysis (no API key needed).",
            "default": ""
          },
          "llmApiKey": {
            "title": "LLM API Key",
            "type": "string",
            "description": "API key for the chosen LLM provider. Only required when an LLM provider is selected."
          },
          "llmModel": {
            "title": "LLM Model (optional)",
            "type": "string",
            "description": "Specific model to use. Defaults: OpenAI=gpt-4o-mini, Google=gemini-1.5-flash, Anthropic=claude-3-haiku-20240307."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}