๐ API Reference
Locentra OS exposes a full REST API built on FastAPI, enabling easy integration with external tools, scripts, or web UIs.
๐ Base URL:
๐ Swagger Docs:
๐งญ API Structure
All endpoints are prefixed with:
๐ค POST /api/llm/query
/api/llm/query
Send a prompt to the model and receive a generated response.
๐งพ Request
โ Response
๐งช Curl Example
๐ POST /api/llm/train
/api/llm/train
Train the model on a new prompt โ completion pair.
๐งพ Request
โ Response
๐ง Optional Add-ons (via metadata)
Semantic vectorization of the prompt
Tagging (for filtered memory access)
Dry-run flag (simulate training without execution)
Use this endpoint to feed real-world data into your model โ one sample at a time.
๐ค POST /api/user/create
/api/user/create
Registers a new user.
๐งพ Request
Note:
โ Response
Used internally by scripts and agents to track prompt provenance or session state.
๐ก GET /api/system/logs
/api/system/logs
Streams live logs from backend activity.
โ Response
Supports optional filtering by level and limit:
/api/system/logs?level=INFO&limit=100
๐ Authentication
Locentra OS ships with open API endpoints by default to support local-first development.
If you need access control:
๐ Add middleware in:
backend/api/middleware/auth.py
๐ Enable token-auth or key-auth in
server.py
๐งฑ Use Docker network isolation or NGINX ACLs for perimeter security
Locentra doesnโt lock you inโbut it gives you the hooks to lock things down.
๐งช Testing & Debugging
You can explore all endpoints via Swagger:
Or test manually with tools like:
curl
(command line)httpie
Postman / Insomnia
Python scripts using
requests
Every call hits the same backend used by the CLI and Web UI โ itโs all one engine.
Last updated