REST API Reference

The Spanlens REST API backs the dashboard and is stable for direct use. All authenticated endpoints require a Supabase JWT in Authorization: Bearer …. Proxy endpoints use a Spanlens API key.

Authentication

Two security schemes are used:

SchemeHeaderUsed for
BearerJWTAuthorization: Bearer <jwt>All /api/v1/* dashboard endpoints
ApiKeyAuthorization: Bearer sl_live_…Proxy endpoints (/proxy/*) and SDK ingest (/ingest/*)

JWTs are obtained from Supabase Auth (supabase.auth.getSession()) and expire after 1 hour. API keys are created in Settings → Projects & API keys and never expire (revoke explicitly when rotating).

Base URLs

EnvironmentBase URL
Production (hosted)https://spanlens-server.vercel.app
Local devhttp://localhost:3001
Self-hostedhttps://your-spanlens.example.com

Endpoint groups

GroupPrefixAuth
HealthGET /healthNone
WaitlistPOST /api/v1/waitlistNone
Organizations/api/v1/organizationsJWT
Projects/api/v1/projectsJWT
API keys/api/v1/api-keysJWT
Provider keys/api/v1/provider-keysJWT
Requests/api/v1/requestsJWT
Stats/api/v1/statsJWT
Traces/api/v1/tracesJWT
Prompts/api/v1/promptsJWT
Anomalies/api/v1/anomaliesJWT
Security/api/v1/securityJWT
Alerts/api/v1/alertsJWT
Recommendations/api/v1/recommendationsJWT
Members/api/v1/organizations/:orgId/membersJWT (admin for writes)
Proxy — OpenAI/proxy/openai/v1/*API key
Proxy — Anthropic/proxy/anthropic/v1/*API key
Proxy — Gemini/proxy/gemini/v1/*API key
SDK Ingest/ingest/*API key

For the full interactive spec — request/response schemas, try-it-out, example curl commands — open the Swagger UI.