Use the API

Use Repokit directly through HTTP

Use the API when you want explicit request control, structured responses, and straightforward backend integration.

Shortest path

  1. 01Getting started
  2. 02Submit a repo
  3. 03Use the API
  4. 04Use MCP
Docs overview

What the API provides

  • Repository-aware file ranking for one ready repository.
  • Direct HTTP + JSON access.
  • A clean way to embed ranking into internal developer tooling.

Authentication

API access requires credentials. For a repository you own, get a verification token from the ready submission detail and pass it as a bearer token.

Primary endpoint

  • POST /find_relevant_files
Base URL: https://api.repokit.co

Where to start reading

Use the human-facing API page at https://repokit.co/api when you want the product overview.

Use the raw base URL above only for actual request traffic.

Quick example

find_relevant_filesbash
curl -sS \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  https://api.repokit.co/find_relevant_files \
  -d '{
    "repository_id": "<repository_id>",
    "query": "fix request validation error in routing",
    "active_files": ["app/routing.py"],
    "recent_files": ["tests/test_routing.py"],
    "failing_tests": ["tests/test_routing.py"],
    "top_k": 5
  }'

Sample response shape

responsejson
{
  "request_id": "feda8a881cd34a39aafc1ac6bbc2a683",
  "repository_id": "<repository_id>",
  "model_version": "lightgbm-lambdamart-v1",
  "candidate_universe_size": 156,
  "files": [
    {
      "path": "app/routing.py",
      "score": 1.145996,
      "confidence": "medium",
      "explanations": [
        {
          "reason_code": "RECENT_EDIT",
          "message": "Recently edited frequently in historical commits.",
          "evidence_type": "heuristic",
          "feature_value": 0.018605
        }
      ]
    },
    {
      "path": "middleware/auth.py",
      "score": 0.710456,
      "confidence": "low",
      "explanations": [
        {
          "reason_code": "RECENT_EDIT",
          "message": "Recently edited frequently in historical commits.",
          "evidence_type": "heuristic",
          "feature_value": 0.027907
        }
      ]
    }
  ],
  "latency_ms": 42,
  "runtime": {
    "repository_id": "<repository_id>",
    "model_version": "lightgbm-lambdamart-v1",
    "ranker_mode": "model",
    "model_backend": "lightgbm",
    "ranking_inputs_source": "benchmark_backfill",
    "runtime_artifact_source": "explicit",
    "runtime_artifact_dir": "/artifacts/benchmarks/<repository_id>",
    "feature_flags": {
      "enable_model_ranking": true,
      "enable_structured_logging": true,
      "persist_evaluation_reports": true
    },
    "warnings": []
  }
}

When to use the API

  • You want direct HTTP requests.
  • You are integrating with backend services or editor workflows.
  • You want structured control over requests and response handling.

Related docs