Skip to content

After upgrading from 0.4.8 to 0.5.1 api key authentication is not working #8100

Description

@df-cgdm

Bug Report

Installation Method

Docker

Environment

  • Open WebUI 0.5.1

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

When I'm calling the API (ollama or openai endpoints) with the API key it should accept it

Actual Behavior:

I get a 403 with the following detail

{
  "detail": "Use of API key is not enabled in the environment."
}

Description

Bug Summary:
Even if ENABLE_API_KEY is True the api_key is not accepted any more.

Reproduction Details

Steps to Reproduce:
1/ Install the version 0.4.8 enable the API Key Auth.
2/ Any call to the api using the API key is working
3/ Upgrade to version 0.5.1
4/ Verify in the Admin UI that Enable API Key Auth is still enabled
5/ Any call to the api using the API key is receiving a 403 "Use of API key is not enabled in the environment."

Logs and Screenshots

Docker Container Logs:
NFO: 10.62.42.19:0 - "GET /openai/models HTTP/1.1" 403 Forbidden

Screenshots/Screen Recordings (if applicable):
API call ScreenShot

Additional Information

For what I've seen this is related to this commit
a2366a2

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