Skip to content

hermes prioritizes OPENAI_API_KEY #289

@bdambrosio

Description

@bdambrosio

even though I run setup and config hermes to use openrouter and provide the openrouter API KEY, it uses my OPENAI_API_KEY from my .bashrc when sending a request to OPENROUTER. needless to say this fails.
this, however, works fine: unset OPENAI_API_KEY && hermes

failure - first, .hermes/.env:

# Hermes Agent Environment Configuration
# Copy this file to .env and fill in your API keys

 =============================================================================
# LLM PROVIDER (OpenRouter)
# =============================================================================
# OpenRouter provides access to many models through one API
# All LLM calls go through OpenRouter - no direct provider keys needed
# Get your key at: https://openrouter.ai/keys
OPENROUTER_API_KEY=sk-or-v1-6cbd...

and request dump:

{
  "timestamp": "2026-03-02T09:29:00.544352",
  "session_id": "20260302_092850_90eee2",
  "reason": "non_retryable_client_error",
  "request": {
    "method": "POST",
    "url": "https://openrouter.ai/api/v1/chat/completions",
    "headers": {
      "Authorization": "Bearer sk-EoVp8...29We", <<<<<<<<<<<<<<<<<< this is my OPENAI_API_KEY!!!!!!!!!
      "Content-Type": "application/json"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions