Skip to main content

Error Handling

All OpenBits API responses follow a consistent envelope format. Errors include machine-readable codes for programmatic handling.

Response Format

Success

Error

Error Codes

Authentication Errors (4xx)

Billing Errors

Rate Limiting

Resource Errors

Validation Errors

Server Errors

Retry Logic

Credits are automatically refunded on upstream 5xx errors. Rate-limited requests (429) are rejected before credit deduction, so no credits are charged.
Safe to retry:
  • 429 — Wait for retry-after seconds, then retry
  • 502 — Upstream error, retry with exponential backoff
  • 500 — Server error, retry with backoff (up to 3 attempts)
Do not retry:
  • 400, 401, 403, 404, 422 — Fix the request first
  • 402 — Add credits or upgrade your plan

Request IDs

Every response includes an x-request-id header. Include this ID when contacting support — it allows us to trace the full request lifecycle in our logs.