ReferenceAPI summary

API summary

A compact reference for the versioned API. Base URL: http://127.0.0.1:8000.

Audience: developers integrating against the API. What you will accomplish: find the right endpoint and know which headers to set and log.

Endpoints

Method & pathPurpose
POST /api/v1/chatAsk a question; returns { answer, sources[], meta }. See Chatting.
POST /api/v1/chat/streamSame body, streamed as SSE. See Streaming.
POST /api/v1/ingestIngest from a remote URL → 202 + Location. See Ingestion.
POST /api/v1/ingest/uploadIngest an uploaded local file (multipart) → 202 + Location.
GET /api/v1/ingest/status/{doc_id}Poll ingest status.
GET /api/v1/ingest/docs?limit&cursorList ingested documents (paginated).
DELETE /api/v1/ingest/{doc_id}Delete a document (always needs X-API-Key).
GET /api/v1/review/pending?limit&cursorList synthesized answers awaiting review (API-key gated). See Review workflow.
POST /api/v1/review/{entry_id}/approveApprove a synthesized answer → embed into the KB (API-key gated).
POST /api/v1/review/{entry_id}/rejectReject a synthesized answer → discard (API-key gated).
POST /api/v1/feedbackSubmit 👍/👎 feedback (open). See Rating answers.
GET /api/v1/feedback?rating&limit&cursorList feedback (operator, API-key gated).
GET /healthCached startup health: ok or degraded.
GET /readyLive readiness probe: 200 ready, or 503 with dependency detail.

Request headers

HeaderPurposeRequired?
X-User-IdScopes conversation memory. Allowed: [A-Za-z0-9_.@-], ≤128 chars.Optional (defaults to anonymous).
X-API-KeyProtects ingest management.DELETE always; others when REQUIRE_AUTH_FOR_INGEST=true.
Content-Type: application/jsonFor JSON request bodies.For chat/feedback/URL-ingest.

Response headers to log

HeaderWhy it matters
X-Correlation-IdTrace a single request end-to-end; matches meta.correlation_id. Quote it in support requests.
X-RateLimit-LimitYour per-window request budget.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetWhen the window resets (epoch seconds).
Retry-AfterOn 429: seconds to wait before retrying.

Verify your result

  • Verify: Your client logs X-Correlation-Id from every response.
  • Verify: You read the X-RateLimit-* headers and back off on 429 per Retry-After.
  • Verify: You send a stable X-User-Id for memory and an X-API-Key where required.

Common mistakes and fixes

  • Using /api/* for new code → switch to /api/v1; the legacy paths are deprecated.
  • Not logging X-Correlation-Id → you lose the ability to trace issues; log it always.