Skip to main content

API Error Handling

This document outlines the standard error responses and status codes used in the StableStack API. All error responses follow a consistent format to help you handle errors gracefully in your application.

Error Response Format

All error responses follow this JSON structure:

HTTP Status Codes

4xx Client Errors

5xx Server Errors

Common Error Codes

Authentication Errors (401)

Validation Errors (400, 422)

Resource Errors (404)

Rate Limiting (429)

Best Practices

  1. Always check the status code first to determine if the request was successful
  2. Handle rate limiting by implementing exponential backoff
  3. Log error details for debugging purposes
  4. Implement retry logic for 5xx errors

Rate Limiting

The API implements rate limiting to ensure fair usage and system stability. Rate limits are applied per API key and are reset every minute.
  • Standard: 60 requests per minute
When rate limited, you’ll receive a 429 status code with the following response: