{
  "openapi": "3.0.1",
  "info": {
    "title": "GitHub Repo to RAG Chunks & LLM Context",
    "description": "Turn any public or private GitHub repo into token-counted, line-cited RAG chunks and one LLM-ready context file. One archive download, no API quota, secrets masked, license and commit included. Not affiliated with GitHub.",
    "version": "1.0",
    "x-build-id": "rdsmvMjEO8dctskm7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mmdincer~github-repo-rag-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mmdincer-github-repo-rag-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/mmdincer~github-repo-rag-extractor/runs": {
      "post": {
        "operationId": "runs-sync-mmdincer-github-repo-rag-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/mmdincer~github-repo-rag-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-mmdincer-github-repo-rag-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",
        "properties": {
          "repositories": {
            "title": "GitHub repositories",
            "maxItems": 100,
            "type": "array",
            "description": "One per line. Accepts <code>https://github.com/owner/repo</code>, a link into a branch or folder (<code>…/tree/main/docs</code>), <code>owner/repo</code> and <code>owner/repo@v1.2.0</code> (branch, tag or commit). Up to 100 per run. Forks, private repositories (with a token) and archived repositories all work.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Read repositories from a dataset",
            "type": "string",
            "description": "Optional. Pick an Apify dataset whose items contain GitHub repository links, for example the output of a GitHub search or trending Actor. The Actor looks for <code>repositoryUrl</code>, <code>url</code>, <code>html_url</code>, <code>fullName</code> and similar fields, so you can chain it without copying links by hand. The dataset is opened read-only."
          },
          "mode": {
            "title": "What to return",
            "enum": [
              "chunks",
              "files",
              "both"
            ],
            "type": "string",
            "description": "<b>Chunks</b> writes one repository row plus one row per token-counted chunk, which is what an embedding job wants. <b>Whole files</b> writes one row per file with its full text. <b>Both</b> writes everything. The Markdown context file is controlled separately below.",
            "default": "chunks"
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 64,
            "maximum": 4096,
            "type": "integer",
            "description": "Token budget per chunk, counted with the cl100k_base tokenizer that OpenAI embedding and chat models use. 512 is a good default for code and docs; use 256 for narrow lookups and 1024 or more to keep whole functions together.",
            "default": 512
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 2048,
            "type": "integer",
            "description": "Text from the end of one chunk repeated at the start of the next, in whole lines, so a function that straddles a boundary is still findable. 64 by default. At most half the chunk size.",
            "default": 64
          },
          "ref": {
            "title": "Branch, tag or commit",
            "type": "string",
            "description": "Read this ref instead of the default branch. A <code>/tree/…</code> link or <code>owner/repo@ref</code> in the repository list wins over this field. Pin a tag or a commit SHA for reproducible results."
          },
          "paths": {
            "title": "Folders or files",
            "type": "array",
            "description": "Only read these folders or files (paths from the repository root, one per line, case does not matter). Empty means the whole repository. Reading <code>docs</code> alone costs only the files in <code>docs</code>.",
            "items": {
              "type": "string"
            }
          },
          "includePatterns": {
            "title": "Include patterns",
            "type": "array",
            "description": "Glob patterns a file must match to be read, for example <code>*.py</code> or <code>src/**/*.ts</code>. A pattern without a slash matches the file name anywhere; case does not matter. Empty means everything the default filters allow.",
            "items": {
              "type": "string"
            }
          },
          "excludePatterns": {
            "title": "Exclude patterns",
            "type": "array",
            "description": "Glob patterns to leave out, for example <code>**/*.test.ts</code> or <code>docs/</code> (a trailing slash means the folder). Exclude always wins over include.",
            "items": {
              "type": "string"
            }
          },
          "redactSecrets": {
            "title": "Mask secrets",
            "type": "boolean",
            "description": "Replace private keys and well-known token formats (AWS, GitHub, Slack, Stripe, OpenAI, Google, npm, Twilio) with <code>[REDACTED:type]</code> before the text is written. This is a pattern check, not a guarantee; do not rely on it to publish a private repository.",
            "default": true
          },
          "includeMetadata": {
            "title": "Add repository metadata",
            "type": "boolean",
            "description": "Add description, stars, forks, topics, default branch and last push from the GitHub API with one request per repository. Anonymous API access is limited to 60 requests an hour per IP, so on a busy platform this can be skipped: the row then says <code>metadataStatus: unavailable</code> and the files are still complete. A GitHub token makes it reliable.",
            "default": true
          },
          "buildContextFile": {
            "title": "Write a Markdown context file",
            "type": "boolean",
            "description": "Save one <code>CONTEXT-owner-repo.md</code> per repository to the key-value store: directory tree plus the files in reading order (README first), cut at the token budget below. Paste it straight into an LLM chat.",
            "default": true
          },
          "contextTokenBudget": {
            "title": "Context file budget (tokens)",
            "minimum": 1000,
            "maximum": 1000000,
            "type": "integer",
            "description": "The context file stops adding files when this many tokens are reached, so it always fits the model you target. 100000 fits most long-context models.",
            "default": 100000
          },
          "maxRepositories": {
            "title": "Maximum repositories per run",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Upper bound on how many repositories are processed in one run, after the list and the dataset are merged. Extra repositories are left out and counted in the run summary. A low number is a simple way to cap the cost of a first run.",
            "default": 100
          },
          "maxFilesPerRepository": {
            "title": "Maximum files per repository",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many files. Files are read in priority order (README, license, docs, source, tests), so a limit cuts tests and examples before it cuts the README.",
            "default": 500
          },
          "maxFileKb": {
            "title": "Maximum file size (KB)",
            "minimum": 1,
            "maximum": 2048,
            "type": "integer",
            "description": "Skip files larger than this. Large files are usually data dumps, generated code or logs.",
            "default": 256
          },
          "maxArchiveMb": {
            "title": "Maximum archive size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Refuse repositories whose compressed archive is larger than this, before reading anything. For a huge repository, a folder from the Folders field does not shrink the download, so raise this limit deliberately.",
            "default": 100
          },
          "maxChunksPerRepository": {
            "title": "Maximum chunks per repository",
            "minimum": 10,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety cap on chunk rows for one repository. A very small chunk size on a very large repository would otherwise write tens of thousands of rows. The repository row says <code>truncated</code> when the cap is hit.",
            "default": 5000
          },
          "githubToken": {
            "title": "GitHub token (optional)",
            "type": "string",
            "description": "A personal access token with read access to contents. Needed only for private repositories and for reliable metadata. With a token the archive comes from the official GitHub API and counts against your own rate limit. The token is stored encrypted, never written to the dataset or the log."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}