Overview
Fallbacks ensure your application stays reliable by automatically switching to an alternative model when the primary one fails. OpenModex supports both server-side and client-side fallbacks.Server-Side Fallbacks
Configured per request. OpenModex handles the failover on the server:- Try
gpt-4o - If it fails (5xx, rate limit, timeout) → try
claude-3.5-sonnet - If that fails → try
gemini-2.0-flash - If all fail → return error
Client-Side Fallbacks
Configured on the SDK client. Applies to all requests:When Fallbacks Trigger
Fallbacks are triggered by:- 5xx errors — server errors from the provider
- 429 errors — rate limit exceeded
- Timeouts — request didn’t complete in time
- Network errors — connection failures
- 4xx errors (except 429) — these indicate a problem with your request
- Successful responses — even if the content is unexpected