Skip to content

Improve error message for 401 / invalid API key (avoid "local model" confusion) #5776

@vlabsc

Description

@vlabsc

When using ChatOpenAI with an invalid or wrong API key, the user sees: 401 Invalid model key or Incorrect local model configuration.

This is misleading because:

  1. The actual cause was an invalid/wrong API key (401 from the API).
  2. The “or Incorrect local model configuration” part suggests Ollama/local setup, which doesn’t apply when using OpenAI.

Suggestion: For 401 responses from the OpenAI (or similar) API, show a clearer message, e.g.: 401 Unauthorized – check your API key and that it has access to the requested model.

Keep a separate message for real local-model issues (e.g. connection to Ollama), so users aren’t sent down the wrong path.

Version: 3.0.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions