Base URL
langsight serve or docker compose up -d api.
Authentication
The API currently has no authentication in the open-source version. In production, place it behind a reverse proxy (nginx, Caddy) and restrict access to your network.Interactive docs
Once the API is running:- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Endpoints
Meta
| Method | Path | Description |
|---|---|---|
GET | /api/status | API health check — returns {"status": "ok"} |
Health
| Method | Path | Description |
|---|---|---|
GET | /api/health/servers | Latest health for all configured servers |
GET | /api/health/servers/{name} | Latest health for one server |
GET | /api/health/servers/{name}/history | Health history (newest first) |
POST | /api/health/check | Trigger on-demand health check |
Security
| Method | Path | Description |
|---|---|---|
POST | /api/security/scan | Run security scan on all servers |
Traces
| Method | Path | Description |
|---|---|---|
POST | /api/traces/spans | Ingest ToolCallSpan JSON from the SDK |
POST | /api/traces/otlp | Ingest standard OTLP/JSON traces |
GET | /api/traces/spans | Query spans by server, tool, session, time range |
Agent Sessions
| Method | Path | Description |
|---|---|---|
GET | /api/agents/sessions | List agent sessions with aggregated cost, call count, and failure count |
GET | /api/agents/sessions/{session_id} | Full span tree for one session, ordered by time, with parent_span_id hierarchy |