Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt

Use this file to discover all available pages before exploring further.

Error Handling

The API returns standard HTTP status codes to indicate success or failure of requests.

Error Response Format

{
  "code": "not_found",
  "message": "The requested resource was not found"
}

Common Error Codes

StatusError TypeDescription
400Bad RequestInvalid request parameters
401UnauthorizedMissing or invalid authentication
403ForbiddenInsufficient permissions
404Not FoundResource does not exist
422Validation ErrorRequest validation failed
429Rate LimitedToo many requests
500Server ErrorInternal server error

SDK Error Handling

from meibel import MeibelClient
from meibel.exceptions import ApiError, NotFoundError, RateLimitError

client = MeibelClient(api_key="your-api-key")

try:
    result = client.items.get_item(id="item-123")
except NotFoundError as e:
    print(f"Item not found: {e.message}")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
except ApiError as e:
    print(f"API error: {e.status_code} - {e.message}")

Retry Strategy

For transient errors (429, 5xx), we recommend implementing exponential backoff:
  1. Wait 1 second, then retry
  2. If still failing, wait 2 seconds, then retry
  3. If still failing, wait 4 seconds, then retry
  4. Maximum of 3 retries
The SDKs implement automatic retry with exponential backoff for transient errors.