REST API
Everything the site shows is available as JSON under https://qed.so/api/v1. Reads need no key. The OpenAPI 3.1 document is at /api/openapi.json. For agents there is also an MCP server.
Endpoints
| Request | Returns |
|---|---|
GET /api/v1/theorems | Search or list verified theorems |
GET /api/v1/theorems/{project}/{name} | One theorem with its statement, kernels, axioms, environment and runs |
GET /api/v1/verifications/{id} | One verification run with its steps, attestation and files |
GET /api/v1/verifications/{id}/steps/{n}/log | One step's log as plain text |
GET /api/v1/verifications/{id}/files/{name} | A file of a run: spec.json and environment.json for a witness, or a submitted pair's sources |
GET /api/v1/log/head | The newest signed head of the log |
GET /api/v1/log/entries | Log entries after a position, oldest first |
GET /api/v1/log/entries/{seq} | One log entry |
GET /api/v1/sources | Every source |
GET /api/v1/sources/{id} | One source |
GET /api/v1/projects | Projects with verified theorems |
GET /api/v1/projects/{slug} | One project |
GET /api/v1/fields | Fields and areas with counts |
POST /api/v1/submissions | Retired repository submission |
GET /api/v1/submissions/{id} | Where a submission stands |
POST /api/v1/check | Check one Lean file through PISA |
GET /api/v1/statements/find | Has this been proved already? (query form) |
POST /api/v1/statements/find | Has this been proved already? |
POST /api/v1/witness-runs | Post a signed witness run |
GET /api/v1/status | Queue, workers, PISA and the log |
GET /api/v1/version | What this server was built from |
POST /api/v1/native/projects/{project}/drafts | Queue verification of a private QED revision |
GET /api/v1/native/drafts/{id} | Read the status of a QED draft you own |
GET /api/v1/native/drafts/{id}/runs/{run} | Read a private run and its steps |
POST /api/v1/native/drafts/{id}/publish | Publish an exact passing verification |
GET /api/v1/native/search | Search theorems in published QED releases |
GET /api/v1/native/releases/{id} | Download a published native revision and its attestation |
GET /api/v1/native/releases/{id}/theorems/{name} | Read a theorem and its connections in an exact release |
POST /api/v1/native/collections | Publish an ordered collection of public QED revisions |
GET /api/v1/native/collections/{account}/{slug}/{version} | Read a collection release and the status of its exact revisions |
Examples
Search, then read one theorem:
curl -s 'https://qed.so/api/v1/theorems?q=infinitely+many+primes&limit=3' | jq '.items[] | {name, project, status}'
curl -s https://qed.so/api/v1/theorems/mathlib/Nat.Prime.two_le | jq '{name, statement, status, kernels: [.kernel_verdicts[] | "\(.name): \(.verdict)"]}'
To verify Lean source, upload a draft with a QED access token or use the workspace. See the CLI commands.
Errors
Every error is JSON with a code, a message and what to do next, and a status that matches the code:
{"error": {"code": "not_found", "message": "QED has no theorem Nat.foo in mathlib.", "next": "Search with GET /api/v1/theorems?q=Nat.foo. Only verified theorems are listed."}}
Codes: bad_request 400, not_found 404, submission_retired 410, invalid 422 (with fields), not_supported 422, rate_limited 429, unavailable 503, internal 500.
Paging
Lists return items, total where it is cheap to count, and next_cursor. Pass the cursor back as cursor to get the next page. limit is at most 100.
Rate limits
Each client address can send 600 reads and 10 Lean checks a minute. Each account can upload 20 drafts an hour. Rate-limited responses carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. A refused request gets 429 with Retry-After in seconds.
Browsers
GET requests answer any origin (Access-Control-Allow-Origin: *). POST requests are for servers and agents and carry no CORS headers.
Pages as markdown
Theorem and project pages also come as markdown. Add .md to the address, or send Accept: text/markdown.