Skip to main content

Error Response Format

All errors follow this structure:
{
  "data": null,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message"
  },
  "meta": {
    "request_id": "d6a8f6f2-3b5a-4f0a-81ab-1b4a4c9dd5ea",
    "timestamp": "2026-03-08T21:56:33.877635522Z",
    "version": "1.0.0"
  }
}

Error Codes

CodeHTTP StatusDescription
MISSING_API_KEY401API key header missing
INVALID_API_KEY401Invalid or revoked API key
API_KEY_DISABLED403API key disabled
INVALID_INPUT400Request body is missing or malformed
PAYLOAD_TOO_LARGE413Request body exceeds size limit
MINUTE_LIMIT_EXCEEDED429Per-minute rate limit exceeded (includes Retry-After: 60 header)
DAILY_LIMIT_EXCEEDED429Daily request limit exceeded (includes Retry-After: 3600 header)
MONTHLY_LIMIT_EXCEEDED429Monthly request limit exceeded (includes Retry-After: 3600 header)
IP_RATE_LIMITED429Too many failed auth attempts from this IP
INTERNAL_ERROR500Server error
REQUEST_TIMEOUT503Request exceeded the server timeout (10 seconds)
REDIS_UNAVAILABLE503Rate limiter temporarily unavailable (free tier only — paid users are unaffected). Includes Retry-After: 30 header.

Common Errors

Missing API Key (401)

{
  "data": null,
  "error": {
    "code": "MISSING_API_KEY",
    "message": "A valid API key must be supplied in the x-api-key header."
  },
  "meta": { "request_id": "...", "timestamp": "...", "version": "1.0.0" }
}
Solution: Add your API key to the x-api-key header.

Invalid API Key (403)

{
  "data": null,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API key."
  },
  "meta": { "request_id": "...", "timestamp": "...", "version": "1.0.0" }
}
Solution: Check that your API key is correct and not revoked.

Rate Limit Exceeded (429)

{
  "data": null,
  "error": {
    "code": "MINUTE_LIMIT_EXCEEDED",
    "message": "Per-minute rate limit exceeded. Retry after 60 seconds."
  },
  "meta": { "request_id": "...", "timestamp": "...", "version": "1.0.0" }
}
Solution: For all rate limit errors, check the Retry-After header and wait the indicated number of seconds before retrying. Alternatively, upgrade your plan to increase your limits.

Handling Errors in Code

try {
  const response = await client.analyzeMessage("...");

  if (response.error) {
    console.error(`Error: ${response.error.code}`);
    console.error(`Message: ${response.error.message}`);
    // Handle specific error codes
    if (response.error.code === 'MINUTE_LIMIT_EXCEEDED') {
      // Check Retry-After header and wait
    } else if (response.error.code === 'DAILY_LIMIT_EXCEEDED') {
      // Wait for daily reset
    }
  }
} catch (error) {
  console.error('Network error:', error);
}

Request IDs

Every response includes a request_id in the meta object. Include this ID when contacting support for faster issue resolution.