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
Authentication
OpenRAG uses JWT Bearer tokens. Obtain a token via the login endpoint, then include it in all subsequent requests.Login
Using the token
Auth endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
POST | /auth/login | — | Get JWT token |
GET | /auth/me | User | Current user profile |
GET | /auth/users | Admin | List all users |
POST | /auth/users | Admin | Create user |
DELETE | /auth/users/{id} | Admin | Delete user |
PATCH | /auth/users/{id}/password | Admin | Change password |
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.Recommended Headers
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
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Invalid request |
| 404 | Resource not found |
| 500 | Server error |
| 504 | Timeout |
Client Examples
Python
JavaScript/Node.js
cURL
Interactive Documentation
OpenRAG provides interactive Swagger UI documentation accessible at:Support
For any questions about the API:- 🐛 Issues: github.com/3ntrop1a/openrag/issues

