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

StatusCodeDescription
400MISSING_PROVIDERCould not detect provider from API key prefix and X-SpendLil-Provider header not set
400MISSING_AUTHX-Provider-Key header not provided
401INVALID_ACCOUNT_KEYX-SpendLil-Key is invalid or account not found
401ACCOUNT_INACTIVEAccount is suspended or cancelled
429PROVIDER_RATE_LIMITRate limit from the AI provider (not SpendLil)
502PROVIDER_UNREACHABLECould not connect to the AI provider
503SERVICE_UNAVAILABLESpendLil gateway temporarily unavailable

Dashboard API Errors

StatusCodeDescription
400VALIDATION_ERRORRequest body failed validation
401UNAUTHORIZEDMissing or invalid JWT token
403FORBIDDENUser does not have permission for this action
404NOT_FOUNDResource not found
409CONFLICTResource already exists or state conflict
422PLAN_LIMITAction exceeds plan limits (keys, users, etc.)
500INTERNAL_ERRORUnexpected 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
  }
}