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
- Always catch errors — don’t let API failures crash your app
- Use fallbacks — configure fallback models for critical paths
- Log the request_id — include
response.openmodex.request_idin error reports for support - Set appropriate timeouts — longer for complex prompts, shorter for simple queries
- Handle streaming errors — streams can fail mid-response; buffer partial content