When multiple keys are configured for a provider, the gateway automatically fails over between them:Documentation Index
Fetch the complete documentation index at: https://ngrok.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
- Keys are tried in reverse order of attachment—the most recently attached key first.
- If a key fails, the next key is tried automatically.
- Failover triggers include:
- Rate limit errors (HTTP 429)
- Quota exceeded responses from the provider
- Timeout or server errors (HTTP 5xx)
With attached provider keys
Attach multiple keys for the same provider to your AI Gateway API Key. The most recently attached key is tried first, then the gateway falls back to older keys in reverse order of attachment:With Traffic Policy keys (custom providers only)
For custom or self-hosted providers, configure multiple keys in Traffic Policy:providers[].api_keys is deprecated for standard providers. Use attached provider keys instead.Next steps
- Attaching Provider Keys: attach and manage provider keys on your AI Gateway API Key
- Managing Provider Keys: storing and rotating Traffic Policy keys for custom providers
- Bring Your Own Keys: overview of provider key options