Skip to main content

Error Response Format

All API errors return a consistent JSON format:

Error Types

SDK Error Handling

Automatic Retries

All SDKs automatically retry on transient errors (429, 500, 502, 503, 504) with exponential backoff:

Best Practices

  1. Always catch errors — don’t let API failures crash your app
  2. Use fallbacks — configure fallback models for critical paths
  3. Log the request_id — include response.openmodex.request_id in error reports for support
  4. Set appropriate timeouts — longer for complex prompts, shorter for simple queries
  5. Handle streaming errors — streams can fail mid-response; buffer partial content