Public API

RepoContext for CI bots and IDE plugins

A single HTTP endpoint that turns any GitHub repository into a high-quality AGENTS.md /CLAUDE.md / Cursor rules / Copilot instructions pack. Same pipeline as the web app, accessible from any language that speaks HTTPS.

Getting an API key

  1. Sign in to your dashboard.
  2. Scroll to the Developer API section and click Create new key.
  3. Save the plaintext key — it is shown only once.
  4. Store it as a secret (e.g. REPOCONTEXT_API_KEY) in your CI / shell environment.

POST /api/v1/analyze

Headers

  • Authorization: Bearer rc_live_… — required
  • Content-Type: application/json — required

Body

{
  "repoUrl": "https://github.com/<owner>/<repo>"
}

Example: curl

curl -X POST https://www.repocontext.dev/api/v1/analyze \
  -H "Authorization: Bearer rc_live_xxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"repoUrl":"https://github.com/octocat/Hello-World"}'

Example: JavaScript / fetch

import { RepoContext } from "@repocontext/sdk"; // coming soon
// or use the raw HTTP client
const res = await fetch("https://www.repocontext.dev/api/v1/analyze", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.REPOCONTEXT_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ repoUrl: "https://github.com/octocat/Hello-World" })
});
const analysis = await res.json();
console.log(analysis.agentsMd); // write to AGENTS.md

Response (truncated)

{
  "repo": { "fullName": "octocat/Hello-World", "stars": 1234, ... },
  "facts": { "framework": "Rails", "packageManager": "bundler", ... },
  "formats": {
    "agentsMd": "# AGENTS.md\n...",
    "claudeMd": "# CLAUDE.md\n...",
    "cursorRules": "...",
    "copilotInstructions": "..."
  },
  "quality": { "score": 87, "breakdown": { ... } },
  "audit": [ ... ],
  "evidence": [ ... ],
  "agentsMd": "# AGENTS.md\n...",
  "usedLLM": true,
  "meta": { "apiKey": { "id": "...", "prefix": "rc_live_aB3x" }, "plan": "pro" }
}

Errors

StatusMeaning
401Missing, malformed, or revoked API key.
400Body did not include { repoUrl: string }.
402Free tier exhausted for this account — upgrade to continue.
429Per-minute rate limit for this key exceeded. Wait for Retry-After, then retry.
503Server not configured (Supabase/GitHub credentials missing).
500Upstream failure (GitHub unavailable, scanner error).

Limits and quotas

Every API key carries a per-minute rate limit (default 30 requests/min), and it is enforced: the 31st request in a minute returns 429 with a Retry-After header. Successful responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; the same numbers are in meta.rateLimit. Keys on Pro and Team plans will get higher limits as we ship tiered quotas.

API calls count against your normal plan quota (5 free / month for free accounts, unlimited on paid plans). They are persisted to your analysis history like web analyses, so you can review them in the dashboard.

Security

  • Keys are stored as SHA-256 hashes — we never have the plaintext after creation.
  • Revoking a key is instant and idempotent.
  • All requests require HTTPS.
  • You can have at most 5 active keys per account.