Skip to content

API endpoints

The FastAPI service that serves retrieval over the indexed corpus — the HTTP surface a coding agent (or any client) queries.

Overview

Authentication is JWT bearer (api/auth.py): /health is open, while /ask and /search require a valid token.

Endpoints

GET /health

Liveness check. No authentication.

Returns:

json
{ "status": "ok" }

POST /ask

Retrieval-augmented answer: retrieve the relevant chunks, then ask the configured LLM. Requires a valid JWT.

FieldTypeRequiredDescription
questionstringyesThe natural-language question

Returns { "answer": "…", "sources": [ … ], "provider": "…", "model": "…" }. provider and model identify the LLM that produced the answer.

POST /search

Semantic search only (no LLM) — returns the top matching chunks. Requires a valid JWT.

FieldTypeRequiredDescription
querystringyesThe search query
top_kintegernoHow many chunks to return (default 5)

Returns { "results": [ … ] }.