Fallbacks
Specify model or provider fallback with your Universal endpoint to specify what to do if a request fails.
For example, you could set up a gateway endpoint that:
- Sends a request to Workers AI Inference API.
- If that request fails, proceeds to OpenAI.
graph TD A[AI Gateway] --> B[Request to Workers AI Inference API] B -->|Success| C[Return Response] B -->|Failure| D[Request to OpenAI API] D --> E[Return Response]
You can add as many fallbacks as you need, just by adding another object in the array.