BNLGit

API reference

BNLGit adds a small set of endpoints under Gitea's existing /api/v1 tree. Everything else in that tree is Gitea's own API, documented by Gitea , and unchanged.

Why this page exists

Your instance serves an interactive API browser at /api/swagger, but it documents Gitea's endpoints only — the BNLGit routes below carry no swagger annotations and therefore do not appear there. This page is the reference for them until that gap is closed.

Authentication

Standard Gitea personal access tokens. Mint one at Settings → Applications.

Authorization: token <your-token>

Authorization: Bearer <your-token> is also accepted.

The scope a route needs is listed in the tables below. "Repo writer (code)" means write access to the repository's code unit; "Pro" means the route is available only when the instance runs the Pro edition.

Instance

MethodPathAuthNotes
GET/api/v1/bnlgit/capabilitiesNoneEdition, licence status, feature flags, drift thresholds. Deliberately unauthenticated so a script or agent never has to guess what is enabled.
POST/api/v1/bnlgit/mcpToken, repository scope, ProFleet MCP server. See Connect your agent.

Repository pairing

MethodPathAuthNotes
GET/api/v1/repos/{owner}/{repo}/bnlgit/pairRepo readerCurrent pair state for the repository.
POST/api/v1/repos/{owner}/{repo}/bnlgit/pairRepo writer (code)Create the pairing. Requires llm_credential_ref and llm_model.
POST/api/v1/repos/{owner}/{repo}/bnlgit/repairRepo writer (code)Repair a pairing whose mirror was damaged or deleted, without losing its history.
POST /api/v1/repos/acme/order-service/bnlgit/pair
Authorization: token <your token>
Content-Type: application/json

{
  "llm_credential_ref": "openrouter-primary",
  "llm_model": "anthropic/claude-sonnet-5"
}

Summary jobs

The unit of work behind the Sync Cockpit. One job corresponds to one file's summary.

MethodPathAuthNotes
GET.../bnlgit/summary-jobsRepo readerList jobs and their states.
POST.../bnlgit/summary-jobs/syncRepo writer (code)Reconcile the job list against the current tree.
POST.../bnlgit/summary-jobs/claimRepo writer (code)Claim jobs for generation.
GET.../bnlgit/summary-jobs/{id}Repo readerOne job.
POST.../bnlgit/summary-jobs/{id}/regenerateRepo writer (code)Request regeneration — this is what actually authorises spend.
POST.../bnlgit/summary-jobs/{id}/unflagRepo writer (code)Dismiss a needs_regeneration flag, recording who and when.
POST.../bnlgit/summary-jobs/{id}/generatedRepo writer (code)Record a completed generation.
POST.../bnlgit/summary-jobs/{id}/failedRepo writer (code)Record a failure, retaining the error.
POST.../bnlgit/summary-jobs/{id}/skippedRepo writer (code)Record a deliberate skip.

Model bake-offs

Pro. See Model bake-off.

MethodPathAuth
GET.../bnlgit/model-bakeoffsRepo reader, Pro
POST.../bnlgit/model-bakeoffsRepo writer (code), Pro
GET.../bnlgit/model-bakeoffs/{id}Repo reader, Pro

POST requires "confirm_cost": true and honours an Idempotency-Key header.

Cleanup plans

Pro. See AI repo cleaner and steward.

MethodPathAuth
GET.../bnlgit/cleanup-plansRepo reader, Pro
POST.../bnlgit/cleanup-plansRepo writer (code), Pro
GET.../bnlgit/cleanup-plans/{id}Repo reader, Pro

POST requires "confirm_cost": true when it includes analysis types that make provider calls.

MCP

MethodPathAuth
POST/api/v1/repos/{owner}/{repo}/bnlgit/mcpToken, Pro
POST/api/v1/bnlgit/mcpToken, repository scope, Pro

JSON-RPC 2.0. Full detail, including tool names and client configuration, is in Connect your agent (MCP).

Any endpoint that can spend from your BYOK connection rejects a request that does not carry cost consent:

{ "confirm_cost": true }

Without it you get a 400 explaining that the request would spend from your connection. This is enforced server-side and is not something a client can opt out of. See Managed worker and spend controls.

Errors

Standard Gitea API error shapes and status codes. Two worth calling out:

  • 404 from a Pro-gated route means the edition is not Pro, or the Pro licence is missing or expired — not that the repository is missing.
  • 429 from bake-offs means you hit a per-user or per-repository hourly rate limit.

Something here wrong or missing? Mail docs@bnlgit.com — these pages are the single public source of truth for BNLGit and we would rather fix them than leave you guessing.