What's the bug?
When a BYOK (Bring Your Own Key) OpenRouter key becomes invalid or is revoked, the API returns a generic 500 Internal Server Error with no useful message. The user has no indication that their key has expired — they just see a failed request with no actionable information.
How to reproduce
- Configure a BYOK OpenRouter key in Gateway credentials
- Revoke or invalidate the key from OpenRouter dashboard
- Make any AI request (chat, image, embedding)
- Observe that a generic 500 error is returned with no mention of the key being invalid
Environment (optional)
Any — affects all environments where BYOK is configured