Pich logoPichdocs
Docs menu: API routes

Reference

API routes

Request and response shapes for the four server routes.

All routes accept and return JSON. Errors return { "error": string }.

POST /api/compile

request
{ "advisoryText": "…40 to 12,000 characters…" }
response
{ "checklist": Checklist, "rejected": [{ "item": string, "reason": string }], "meta": { "id", "model", "latencyMs", "totalTokens", "shadowAgent" } }

Limits: 6 requests per minute per IP, 60 per minute overall. Errors: 400 bad input, 429 rate limited, 502 SERV failure.

POST /api/check

request
{ "checklist": Checklist }
response
{ "results": AppResult[] }   // one per demo app

POST /api/check-repo

request
{ "checklist": Checklist, "repoUrl": "https://github.com/owner/repo" }
response
{ "results": [AppResult], "repo": { "name", "url", "ref" } }

Limits: 10 per minute per IP, 50 overall. Errors: 400, 422 repository problem, 429.

POST /api/explain

request
{ "checklist": Checklist, "clientId": "client-a" }   // or "repoUrl"
response
{ "note": { "headline", "summary", "evidence", "unknowns", "recommended_action" }, "meta": {…}, "result": AppResult }

Limits: 10 per minute per IP, 80 overall. Errors: 400, 422, 429, 502.

AppResult

ts
interface AppResult {
  clientId: string;
  clientName: string;
  verdict: "confirmed" | "absent_within_inspected_scope" | "needs_manual_review";
  reason: string;
  conditions: {
    id: string;
    label: string;
    expected: "present" | "absent";
    observed: "present" | "absent" | "unknown";
    status: "met" | "not_met" | "unknown";
    note: string;
    source_quote: string;
    evidence: { file: string; line?: number; text: string }[];
  }[];
  unknowns: string[];
  caveats: string[];
  inspectedFiles: string[];
}

Note

Rate limits are kept in memory per server instance, so they are approximate.

Edit this page on GitHub