Base URL: http://localhost:8000
All API routes are under /api.
Authentication is handled via Supabase. Clients should include a valid Supabase JWT in the Authorization header for endpoints that require user context (e.g., /api/auth/me, /api/settings).
Authorization: Bearer <token>
GET /health
Response
{
"status": "ok"
}GET /api/providers
Response
{
"providers": ["openai", "anthropic"]
}Errors
500if provider loading fails.
POST /api/chat
Request
{
"connection_id": "warehouse",
"prompt": "Top 10 customers by revenue",
"provider": "openai",
"auto_execute": true,
"dialect": "postgresql"
}Response
{
"sql": "SELECT ...",
"provider": "openai",
"model": "gpt-4o-mini",
"tokens": { "prompt": 120, "completion": 90, "total": 210 },
"results": {
"columns": ["customer", "revenue"],
"rows": [["Acme", 1000]],
"row_count": 1
}
}Errors
404if the connection does not exist.400if the provider is not configured.
POST /api/execute
Request
{
"connection_id": "warehouse",
"sql": "SELECT COUNT(*) FROM orders"
}Response
{
"results": {
"columns": ["count"],
"rows": [[123]],
"row_count": 1
}
}Errors
404if the connection does not exist.
POST /api/connections
Request
{
"provider": "postgres",
"name": "warehouse",
"config": {
"host": "db.example.com",
"database": "analytics",
"user": "readonly",
"password": "..."
}
}Response
{
"name": "warehouse",
"provider": "postgres",
"status": {"state": "ready"}
}GET /api/connections/{connection_id}
Response
{
"name": "warehouse",
"provider": "PostgresConnection",
"status": {"state": "ready"}
}Errors
404if the connection does not exist.
DELETE /api/connections/{connection_id}
Response
{ "status": "disconnected" }POST /api/files/upload?bucket=uploads
Request
- Multipart form data with
file.
Response
{
"file_name": "customers.csv",
"storage_path": "uploads/customers.csv",
"content_type": "text/csv",
"size_bytes": 10240
}POST /api/files/profile
Request
- Multipart form data with
file.
Response
{
"row_count": 120,
"columns": [
{"name": "id", "type": "INTEGER", "nulls": 0}
]
}POST /api/lineage
Request
{
"sql": "SELECT * FROM customers",
"dialect": "postgresql"
}Response
{
"query_type": "SELECT",
"tables_read": ["customers"],
"tables_written": [],
"columns_used": ["*"],
"ctes": []
}GET /api/auth/me
Response
{ "id": "...", "email": "user@example.com" }GET /api/settings
Response
{
"user_id": "...",
"settings": {
"theme": "dark"
}
}| Status | Meaning |
|---|---|
| 400 | Bad request / invalid payload |
| 401 | Unauthorized (missing/invalid token) |
| 404 | Resource not found |
| 500 | Server error |
Rate limiting is not enforced by default. Deployments should configure limits at the edge (e.g., Vercel, Cloudflare, or an API gateway).
No webhooks are implemented in the current release.