Skip to content

Cannot use LM Studio despite OpenAI API compatibility – requires OPENAI_API_KEY #767

Description

@jx-it

I'm trying to use LM Studio as an OpenAI-compatible backend, but the application still requires an API key for OpenAI, even though I'm setting the OPENAI_BASE_URL to the LM Studio URL.

Steps to reproduce:

  1. Set environment variables as follows:
    OPENAI_BASE_URL=http://localhost:1234/v1

  2. Run the application without setting OPENAI_API_KEY (since LM Studio doesn’t require one).

Expected behavior:
The app should connect to LM Studio successfully without needing an OpenAI API key.

Actual behavior:
The application immediately fails with the following error message in the log:
level=fatal msg="Please set the OPENAI_API_KEY environment variable for OpenAI provider."

Additional context:
Even when providing a dummy API key, the same error occurs.
It seems the application enforces OPENAI_API_KEY presence regardless of the base URL or provider.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions