Skip to content

[Bug]: BYOK key failure returns generic 500 instead of actionable error #976

@Abh1shxkk

Description

@Abh1shxkk

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

  1. Configure a BYOK OpenRouter key in Gateway credentials
  2. Revoke or invalidate the key from OpenRouter dashboard
  3. Make any AI request (chat, image, embedding)
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions