{
  "openapi": "3.0.1",
  "info": {
    "title": "Codebase Intelligence Pack",
    "description": "Turn GitHub repositories or ZIP archives into AI-ready architecture, routes, dependencies, auth and database reports. Optional file fingerprints, unified JSON and report ZIP. Static analysis needs no AI key.",
    "version": "1.0",
    "x-build-id": "PdC4EbdxU3j85D3nI"
  },
  "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": "Choose a GitHub repository, public HTTP(S) ZIP archive or ZIP pre-uploaded to the default KV store.",
            "default": "github"
          },
          "githubUrl": {
            "title": "GitHub repository URL",
            "type": "string",
            "description": "Full GitHub repository URL. Use branch for branch names containing slashes. Blank uses the Express example repository.",
            "default": "https://github.com/expressjs/express"
          },
          "githubToken": {
            "title": "GitHub read token (optional)",
            "type": "string",
            "description": "Token with read access to the selected repository. Needed for private repositories; never added to output. Organization SSO authorization may be required."
          },
          "branch": {
            "title": "Branch, tag or commit (optional)",
            "type": "string",
            "description": "Explicit branch, tag or commit SHA; overrides a ref in githubUrl. Blank uses the repository default branch.",
            "default": ""
          },
          "zipUrl": {
            "title": "Public ZIP archive URL",
            "type": "string",
            "description": "Required for zipUrl source. HTTP(S) URL returning a ZIP, not an HTML download page. Embedded username/password is not allowed. Signed query parameters are removed from output metadata.",
            "default": ""
          },
          "uploadedZipKey": {
            "title": "Uploaded ZIP record key",
            "type": "string",
            "description": "Required for uploadedZip source. Pre-upload a binary application/zip record to the default KV store used by the run; see README.",
            "default": ""
          },
          "uploadedZipStoreId": {
            "title": "Uploaded ZIP store ID (optional)",
            "type": "string",
            "description": "Existing KV store containing uploadedZipKey. Blank reads from the run’s default store (legacy behavior). Use this field to reuse an uploaded archive across cloud runs; the run must have access to that store.",
            "default": ""
          },
          "maxFileSizeKb": {
            "title": "Maximum file size (KiB)",
            "minimum": 1,
            "maximum": 10240,
            "type": "integer",
            "description": "Skip individual files larger than this many KiB (1024 bytes). Range: 1–10240; lower values reduce scanning time.",
            "default": 500
          },
          "maxFiles": {
            "title": "Maximum indexed files",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop indexing after this many eligible files. Range: 1–100000. Higher values increase memory, time and output sizes.",
            "default": 10000
          },
          "includePatterns": {
            "title": "Include path globs",
            "maxItems": 100,
            "type": "array",
            "description": "Optional list of Python fnmatch-style globs against repository-relative POSIX paths; e.g. src/* or *.py. Not .gitignore syntax. Up to 100 patterns, 1024 characters each.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "excludePatterns": {
            "title": "Exclude path globs",
            "maxItems": 100,
            "type": "array",
            "description": "Skip matching repository-relative paths; explicit exclusions take precedence. Dependency, VCS, build and binary files are always skipped. Up to 100 patterns, 1024 characters each.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "respectGitignore": {
            "title": "Respect root .gitignore",
            "type": "boolean",
            "description": "Opt in to Git ignore/negation semantics from the root .gitignore only. Ignored parents stay pruned; nested .gitignore files are not evaluated. Always-ignored files and explicit exclusions still win.",
            "default": false
          },
          "outputFormat": {
            "title": "Original report formats",
            "enum": [
              "all",
              "json-only",
              "markdown-only"
            ],
            "type": "string",
            "description": "Generate all original reports, only nine JSON analyses, or only two Markdown reports. Explicitly requested bundle/inventory artifacts are independent of this setting.",
            "default": "all"
          },
          "includeConsolidatedOutput": {
            "title": "Consolidated analysis JSON",
            "type": "boolean",
            "description": "Also write analysis.json: versioned source metadata, counts and all nine analysis sections. Off by default; useful for API integrations and AI workflows.",
            "default": false
          },
          "createOutputArchive": {
            "title": "Downloadable ZIP of reports",
            "type": "boolean",
            "description": "Also write intelligence-pack.zip containing exactly this run’s generated reports, including optional JSON artifacts. Never includes uploaded code, INPUT or stale KV records.",
            "default": false
          },
          "includeFileInventory": {
            "title": "File inventory JSON",
            "type": "boolean",
            "description": "Also write file-inventory.json: sorted path, language, bytes, approximate non-comment line count and readability for each indexed file. No file contents.",
            "default": false
          },
          "includeFileHashes": {
            "title": "SHA-256 file fingerprints",
            "type": "boolean",
            "description": "Add SHA-256 hashes to file-inventory.json for comparing snapshots externally. Requires includeFileInventory=true. No incremental cache or change detection is performed.",
            "default": false
          },
          "llmProvider": {
            "title": "AI provider (optional)",
            "enum": [
              "",
              "openai",
              "google",
              "anthropic"
            ],
            "type": "string",
            "description": "Opt-in provider for folder-summary.md only. Blank, a missing API key, json-only output, or maxLlmDirectories=0 uses static analysis. AI is not needed for any core report.",
            "default": ""
          },
          "llmApiKey": {
            "title": "Provider API key",
            "type": "string",
            "description": "Your API key for the selected provider. Sent only to that provider; never added to generated reports or the report archive. The secret input itself remains in Apify input storage under your access controls."
          },
          "llmModel": {
            "title": "Model override (optional)",
            "type": "string",
            "description": "Optional model ID supported by your provider account. Defaults: openai=gpt-4o-mini, google=gemini-3.5-flash-lite, anthropic=claude-haiku-4-5-20251001. Model availability and provider prices may change.",
            "default": ""
          },
          "llmTimeoutSecs": {
            "title": "AI directory deadline (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Total deadline for each optional directory description, including SDK retries. Range: 5–120. A timeout falls back to static descriptions.",
            "default": 30
          },
          "maxLlmDirectories": {
            "title": "Maximum AI-enriched directories",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Enrich up to this many top-level directories in alphabetical order (0 disables AI, max 100). Default 20 bounds provider usage; each request may retry up to twice.",
            "default": 20
          },
          "requestTimeoutSecs": {
            "title": "Source request deadline (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Per-attempt total source download/API deadline, including streaming. Range: 5–600. Transient failures retry up to twice with bounded backoff.",
            "default": 120
          },
          "maxDownloadSizeMb": {
            "title": "Maximum ZIP size (MiB)",
            "minimum": 1,
            "maximum": 1024,
            "type": "integer",
            "description": "Compressed source archive limit for URL and uploaded ZIPs. Range: 1–1024 MiB. Expanded archive hard limit is 2 GiB and 100000 entries.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}