RAGaaS
Documentation

RAG as a Service API

Upload documents into collections, then ask grounded questions and get answers with citations. This is the developer reference for the HTTP API — version 0.2.0.

Base URL

All endpoints are served under a single base URL:

https://rag.lucasfurtado.xyz/api

The machine-readable contract is available as an OpenAPI 3.1 document at /v1/openapi.json (and /v1/openapi.yaml).

60-second quickstart

1. Create an API key. From the dashboard, open API keys and create one. Copy it immediately — the plaintext key is shown exactly once.

2. Ask a question. Point a request at a collection that has at least one ready document. Use "stream": false for a single JSON answer (drop it for a streamed Server-Sent Events response):

curl -X POST 'https://rag.lucasfurtado.xyz/api/v1/collections/col_9f8b2a1c/query' \
  -H 'Authorization: Bearer rag_live_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"query":"What is the refund policy for annual plans?","stream":false}'

3. Read the response. The answer contains inline [n] markers that map to the sources array:

{
  "answer": "Annual plans can be refunded in full within 30 days of purchase [1].",
  "sources": [
    {
      "marker": 1,
      "documentId": "doc_4c1e77a0",
      "filename": "handbook.pdf",
      "page": 12,
      "snippet": "Annual plans are eligible for a full refund within 30 days…",
      "score": 0.82,
      "cited": true
    }
  ],
  "usage": { "chunksRetrieved": 8, "chunksUsed": 5, "contextTokens": 1240, "invalidMarkers": [], "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast" }
}

Prefer to explore interactively? The API reference has a “Try it” console on every endpoint.

Explore