Skip to main content

API Reference

Welcome to the OpenRAG API documentation. This REST API allows you to interact with the RAG system to upload documents, ask questions, and manage your collections.

Base URL

In production, replace with your server’s URL.

Authentication

OpenRAG uses JWT Bearer tokens. Obtain a token via the login endpoint, then include it in all subsequent requests.

Login

Response:

Using the token

Auth endpoints

The default admin account (admin / admin) is created automatically on first startup. Change this password from the Admin panel → Users tab.

Response Format

All API responses are in JSON format.
In case of error:

Rate Limiting

Currently, no rate limiting is applied. In production, a limit of 100 requests/minute per IP will be enforced.

Available Endpoints

Queries (RAG)

POST /query

Process a user query and generate a response

Document Management

POST /documents/upload

Upload a new document

GET /documents

List all documents

GET /documents/{id}

Retrieve a specific document

DELETE /documents/{id}

Delete a document

Collections

GET /collections

List all collections with vector counts

Statistics & History

GET /stats

Aggregate system stats (Postgres + Qdrant + health)

GET /history

Paginated query history (admin only)

System

GET /

API information

GET /health

Health check

HTTP Codes

Client Examples

Python

JavaScript/Node.js

cURL

Interactive Documentation

OpenRAG provides interactive Swagger UI documentation accessible at:
You can directly test all endpoints there!

Support

For any questions about the API: