How failover works
When a routing rule step lists multiple provider keys:- The gateway tries the first key.
- On a rate limit (429), or an auth failure (401 or 403) because the provider rejected the key, it tries the next key.
- When no keys are left, the gateway falls back to paying with credits if the rule has an
ngrokstep after this one. Otherwise it moves to the next model you listed, or returns the last 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