Docs / Resolve

Resolve API

Execution-verified bug fixes over HTTP. Submit an issue, accept the quote, poll until resolved, and share the attestation.

Base URL: https://resolve.codai.ro — all endpoints require a codai API key (Authorization: Bearer codai_…). Mint keys in the console.

Beta scope: public GitHub repos, Python/pytest verification. Your first 3 verified fixes are free; paid fixes are flat-priced at $7 / $19 / $49, quoted before you commit. Failed or unverifiable attempts are never billed.

1. Submit a job

POST /v1/resolve/jobs
Content-Type: application/json
Authorization: Bearer codai_...

{
  "repo_url": "https://github.com/owner/repo",
  "issue_text": "Bug: median() returns the wrong value for even-length input...",
  "test_command": "python -m pytest -q tests/test_stats.py::test_median"  // optional
}

Provide issue_text (or issue_url). If you omit test_command, the agent authors a reproduction test first — it must fail on your current code before any fix is attempted.

201 Created
{
  "id": "2be04832-…",
  "status": "quoted",          // quoted | accepted | declined
  "tier": "t7",
  "quote_micro_usd": 7000000,   // $7.00 — amounts are USD micros
  "triage_reason": "single-function bug with a clear repro",
  "free_tier_remaining": 3
}

2. Accept the quote

POST /v1/resolve/jobs/:id/accept

Free-tier jobs auto-accept. Accepting a paid quote authorizes the flat fee — charged only if the fix verifies. A declined triage costs nothing.

3. Poll status

GET /v1/resolve/jobs/:id

{
  "id": "2be04832-…",
  "status": "resolved",        // triage→quoted→accepted→running→resolved|failed|error
  "cost_micro_usd": 200161,
  "attestation_id": "f3d03bcf-…",
  "attestation_url": "/v1/resolve/attestations/f3d03bcf-…",
  "completed_at": "2026-08-05T17:56:17Z"
}

Typical single-function bugs complete in under 10 minutes. failed means the agent could not produce a verified fix (not billed); error means an infrastructure fault (not billed, safe to retry).

4. Fetch the attestation

GET /v1/resolve/attestations/:id   // public by URL — no auth required

The attestation is the product: the exact unified diff, the repro test content, the before/after test output, the regression suite output, the runner image digest, and timestamps. The URL is unguessable (the UUID is the capability) — share it with your team or link it in the PR.

{
  "repo_url": "https://github.com/owner/repo",
  "base_commit": "9d2e4c1…",
  "patch": "diff --git a/statslib/core.py …",
  "repro_test_path": "codai_repro_test.py",
  "test_output_before": "FAILED … assert 3 == 2.5",
  "test_output_after": "1 passed",
  "regression_output": "247 passed",
  "runner_image_digest": "d6165338",
  "verified_at": "2026-08-05T17:56:17Z"
}

Billing rules

Current limits

Questions or a repo that isn't supported yet? hello@codai.ro — or read the story on the Resolve overview page.