Skip to main content

Error Response Format

All API errors return a consistent JSON structure:
Some errors include additional fields with context-specific information.

HTTP Status Codes

Common Errors

Authentication Errors (401)

Fix: Ensure you’re including a valid API key in the Authorization: Bearer header.

Authorization Errors (403)

Fix: Use the correct API key for the knowledge base you’re querying.

Not Found Errors (404)

Fix: Verify the knowledge base ID is correct.

Rate Limit Errors (429)

Fix: For rate limits, implement backoff and retry. For cap exceeded, upgrade your plan.

Validation Errors (400)

Fix: Check your request format and ensure all required fields are present.

Server Errors (500, 503)

Fix: Retry with exponential backoff. If persistent, contact support.

Error Handling Best Practices

1

Check Status Codes First

Always check the HTTP status code before parsing the response body.
2

Parse Error Response

Extract the error code and message for logging and user feedback.
3

Implement Retry Logic

For 429 and 5xx errors, implement exponential backoff with jitter.
4

Handle Cap Exceeded Gracefully

When query_cap_exceeded, inform users and provide upgrade options.
5

Log Errors

Log error details for debugging, but never log API keys.

Example Error Handler

Need Help?

If you encounter persistent errors or unexpected behavior, contact support at support@ardie.ai with:
  • The error code and message
  • Your request details (without the API key)
  • Timestamp of the error