Skip to content

OPENROUTER_KEY is not passed through to the OpenAI client, resulting in 401 error #7

@cmungall

Description

@cmungall

The docs state that either "You can set that as an environment variable called OPENROUTER_KEY, or add it to the llm set of saved keys"
https://github.com/simonw/llm-openrouter?tab=readme-ov-file#configuration

However, if the env var path is chosen and llm keys set openrouter is not used this results in

Error: Error code: 401 - {'error': {'message': 'Missing Authentication header or invalid API key', 'code': 401}}

On debugging it seems that the OPENAI_KEY env var takes priority.

Either the docs should state that the keys command must be used, or the env var should be passed through.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions