Problem
When using AI Gateway with BYOK (Bring Your Own Key), if a request to my own API key fails for any reason, AI Gateway automatically falls back to the system key. This consumes my AI Gateway Credits unexpectedly.
In my case, I’m using AI Gateway purely as a proxy (e.g., to bypass network restrictions in certain regions) with my own Anthropic API key via Claude Code. I don’t want or need the fallback functionality — I just need the proxy capability.
Current Behavior
-
Request sent with my own API key
-
If request fails (even temporarily), AI Gateway automatically retries with system key
-
My AI Gateway Credits are consumed without my consent
-
There is no way to disable this behavior
Proposed Solution
Please add an option to disable automatic fallback to system keys. For example:
-
A toggle in the dashboard: “Disable system key fallback”
-
Or an API/SDK parameter:
allowSystemKeyFallback: false -
Or a “BYOK-only mode” that never uses system keys
Use Case
-
Users in regions where direct API access is blocked and need AI Gateway as a proxy only
-
Users who want full control over their API costs
-
Users who prefer requests to fail rather than incur unexpected charges
Impact
This would make AI Gateway more accessible to users who only need the proxy/routing functionality, without the risk of unexpected billing.
Thank you for considering this request!