Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.langsight.dev/llms.txt

Use this file to discover all available pages before exploring further.

Usage

langsight serve [OPTIONS]

Options

OptionDefaultDescription
--host0.0.0.0Host to bind to
--port, -p8000Port to listen on
--configauto-discoveredPath to .langsight.yaml
--reloadfalseEnable auto-reload (development only)

What it does

Starts the FastAPI REST API server and (as of v0.9.0) an embedded background monitor loop. The API is used by:
  • The LangSight SDK (POST /api/traces/spans)
  • OTLP integrations (POST /api/traces/otlp)
  • The dashboard
  • Any custom tooling querying health/security data
Embedded monitor (v0.9.0+): langsight serve now starts a continuous health check loop in the background alongside the API. The loop runs every 60 seconds by default. Before v0.9.0, you needed a separate langsight monitor process. Control the embedded monitor with:
Environment variableDefaultEffect
LANGSIGHT_MONITOR_ENABLEDtrueSet false to disable the embedded loop
LANGSIGHT_MONITOR_INTERVAL_SECONDS60Seconds between health check cycles
See Production Deployment for deployment patterns including the advanced separate-monitor setup.

Start the server

langsight serve
Starting LangSight API on http://0.0.0.0:8000
Docs: http://localhost:8000/docs

API documentation

Once running, interactive docs are available at:
  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Endpoints

MethodPathDescription
GET/api/livenessInstant liveness probe — no dependencies checked
GET/api/readinessReadiness probe — checks storage; returns 503 if unhealthy
GET/api/statusAPI health check
GET/api/health/serversLatest health for all servers
GET/api/health/servers/{name}Latest health for one server
GET/api/health/servers/{name}/historyHealth history
POST/api/health/checkTrigger on-demand health check
POST/api/security/scanTrigger security scan
POST/api/traces/spansIngest SDK spans
POST/api/traces/otlpIngest OTLP/JSON traces

Authentication

When LANGSIGHT_API_KEYS is set, all routes require an X-API-Key header:
export LANGSIGHT_API_KEYS=key-abc123,key-def456   # comma-separated; any one is accepted
curl http://localhost:8000/api/health/servers \
  -H "X-API-Key: key-abc123"
Liveness (/api/liveness) and readiness (/api/readiness) probes are always unauthenticated — they are safe to expose to orchestrators such as Kubernetes.

Rate limits

EndpointLimit
POST /api/traces/spans200 req/min
POST /api/traces/otlp60 req/min
POST /api/users/verify10 req/min
All other endpoints200 req/min (global default)
All endpoints are rate-limited via SlowAPIMiddleware. The global default of 200 requests/minute applies to any route without a specific override.

Production deployment

For production, use the root docker-compose.yml:
docker compose up -d
See Self-Hosting for the full production setup.