Base URL: https://api.krelixir.ai (or http://localhost:5000 in development)
All authenticated endpoints require:
Authorization: Bearer <jwt_token>
POST /api/auth/register
// Request
{ "name": "John Smith", "email": "john@company.com", "password": "SecurePass123" }
// Response 201
{ "success": true, "user": { "id": "...", "name": "John Smith", "email": "..." }, "token": "eyJ..." }POST /api/auth/login
// Request
{ "email": "demo@krelixir.ai", "password": "demo1234" }
// Response 200
{ "success": true, "user": {...}, "token": "eyJ..." }GET /api/auth/me 🔒
// Response
{ "success": true, "user": { "id": "...", "name": "...", "email": "...", "role": "admin" } }GET /api/dashboard/stats 🔒
// Response
{
"success": true,
"stats": {
"totalAssets": 23,
"migrated": 4,
"migrating": 2,
"pending": 17,
"totalCurrentCost": 34650,
"totalProjectedCost": 12480,
"totalSavings": 22170,
"savingsPercent": 64,
"migrationReadiness": 72,
"riskScore": "Medium",
"criticalIssues": 2
}
}GET /api/dashboard/activity 🔒
GET /api/dashboard/cost-comparison 🔒
GET /api/inventory 🔒
- Query params:
type,status,search
GET /api/inventory/servers🔒GET /api/inventory/databases🔒GET /api/inventory/applications🔒GET /api/inventory/network🔒
POST /api/inventory 🔒
{
"name": "my-server",
"type": "Server",
"os": "Ubuntu 22.04",
"cpu": 8,
"ram": 32,
"storage": 500,
"status": "active",
"region": "On-Prem / US-East",
"cost": 1200
}PUT /api/inventory/:id 🔒
DELETE /api/inventory/:id 🔒
POST /api/inventory/upload 🔒
- Content-Type:
multipart/form-data - Field:
file(CSV with columns: name, type, os, cpu, ram, storage, status, region, cost)
GET /api/recommendations 🔒
// Response
{
"success": true,
"recommendations": [...],
"totalSavings": 22170,
"count": 19
}POST /api/recommendations/analyze 🔒
GET /api/recommendations/:assetId 🔒
POST /api/ai/chat 🔒
// Request
{ "message": "What are my top 3 cost optimization opportunities?" }
// Response
{
"success": true,
"message": "## Top Cost Optimization Opportunities\n\n...",
"timestamp": "2025-05-24T..."
}GET /api/ai/history 🔒
DELETE /api/ai/history 🔒
name,type,os,engine,stack,cpu,ram,storage,status,region,cost,migration_status
web-server-01,Server,Ubuntu 22.04,,, 8,32,500,active,On-Prem / US-East,1800,pending
prod-db,Database,,MySQL 8.0,,,,, active,On-Prem / US-East,2200,pending// 400 Bad Request
{ "success": false, "message": "Validation error", "errors": [...] }
// 401 Unauthorized
{ "success": false, "message": "No token provided" }
// 404 Not Found
{ "success": false, "message": "Asset not found" }
// 429 Rate Limited
{ "success": false, "message": "Too many requests. Please try again later." }
// 500 Server Error
{ "success": false, "message": "Internal server error" }