Last updated: 2026-04-11
Error Codes
Complete list of SpendLil error codes and their meanings.
SpendLil returns standard HTTP status codes. Errors from the proxy are SpendLil-specific. Errors from the dashboard API follow REST conventions.
Proxy Errors
| Status | Code | Description |
|---|---|---|
| 400 | MISSING_PROVIDER | Could not detect provider from API key prefix and X-SpendLil-Provider header not set |
| 400 | MISSING_AUTH | X-Provider-Key header not provided |
| 401 | INVALID_ACCOUNT_KEY | X-SpendLil-Key is invalid or account not found |
| 401 | ACCOUNT_INACTIVE | Account is suspended or cancelled |
| 429 | PROVIDER_RATE_LIMIT | Rate limit from the AI provider (not SpendLil) |
| 502 | PROVIDER_UNREACHABLE | Could not connect to the AI provider |
| 503 | SERVICE_UNAVAILABLE | SpendLil gateway temporarily unavailable |
Dashboard API Errors
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Request body failed validation |
| 401 | UNAUTHORIZED | Missing or invalid JWT token |
| 403 | FORBIDDEN | User does not have permission for this action |
| 404 | NOT_FOUND | Resource not found |
| 409 | CONFLICT | Resource already exists or state conflict |
| 422 | PLAN_LIMIT | Action exceeds plan limits (keys, users, etc.) |
| 500 | INTERNAL_ERROR | Unexpected server error |
Error Response Format
json Error response body
{
"error": {
"code": "INVALID_ACCOUNT_KEY",
"message": "The X-SpendLil-Key header contains an invalid account key.",
"status": 401
}
}