How failover works
When a routing rule step lists multiple provider keys:- The gateway tries the first key.
- On rate limit (429), auth failure, or certain upstream errors, it tries the next key.
- If all keys in the step fail, the gateway tries the next step in the rule (if any), or returns an error.
Via dashboard
- Add multiple provider keys for the same provider.
- Edit an access key configuration.
- Add or edit a routing rule for the provider.
- Attach multiple keys to the Bring your own API key step in the order you want them tried.
Via the AI Gateway API
Next steps
- Bring your own provider key: Store upstream credentials
- Access Key Configurations: Routing rules and scope
- How It Works: Full request flow