Last updated: 2026-04-20

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_SPENDLIL_KEYX-SpendLil-Key header not provided
400MISSING_AUTHNo provider auth header (Authorization / x-api-key / x-goog-api-key)
400UNKNOWN_PROVIDERGateway subdomain does not match a supported provider
401INVALID_SPENDLIL_KEYSpendLil account not found for this key
403ACCOUNT_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_SPENDLIL_KEY",
    "message": "The X-SpendLil-Key header contains an invalid account key.",
    "status": 401
  }
}