# NousResearch/hermes-agent · Hermes doctor handling of OPENAI_BASE_URL custom endpoints

## Open now

- Nothing open on GitHub.

One issue reports OPENAI_API_KEY not being recognized with a localhost OPENAI_BASE_URL, and two pull requests propose changes to the doctor command to detect custom OpenAI endpoint environment settings and check connectivity. The titles suggest a shared theme, but the cluster does not show whether the changes address the reported problem.

## TL;DR

- 3 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #573. Verify it addresses your case.
- **Recommended:** read PR #573 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-573`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.67`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #572: \[Bug\]: OPENAI_API_KEY set but not being recognized by hermes(not connecting at all) or hermes doctor with OPENAI_BASE_URL localhost

## Prior & competing PRs

- **#573: fix(doctor): detect OpenAI custom endpoint env settings**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `hermes_cli/doctor.py`, `tests/hermes_cli/test_doctor.py`
  - fix hunks:
  - `hermes_cli/doctor.py`

    ```diff
    @@ -33,6 +33,26 @@
     from hermes_cli.colors import Colors, color
     from hermes_constants import OPENROUTER_MODELS_URL
     
    +
    +_PROVIDER_ENV_HINTS = (
    +    "OPENROUTER_API_KEY",
    +    "OPENAI_API_KEY",
    +    "ANTHROPIC_API_KEY",
    +    "OPENAI_BASE_URL",
    +    "GLM_API_KEY",
    +    "ZAI_API_KEY",
    +    "Z_AI_API_KEY",
    +    "KIMI_API_KEY",
    +    "MINIMAX_API_KEY",
    +    "MINIMAX_CN_API_KEY",
    +)
    +
    +
    +def _has_provider_env_config(content: str) -> bool:
    +    """Return True when ~/.hermes/.env contains provider auth/base URL settings."""
    +    return any(key in content for key in _PROVIDER_ENV_HINTS)
    +
    +
     def check_ok(text: str, detail: str = ""):
         print(f"  {color('✓', Colors.GREEN)} {text}" + (f" {color(detail, Colors.DIM)}" if detail else ""))
     
    ```

    ```diff
    @@ -132,12 +152,8 @@ def run_doctor(args):
             
             # Check for common issues
             content = env_path.read_text()
    -        if any(k in content for k in (
    -            "OPENROUTER_API_KEY", "ANTHROPIC_API_KEY",
    -            "GLM_API_KEY", "ZAI_API_KEY", "Z_AI_API_KEY",
    -            "KIMI_API_KEY", "MINIMAX_API_KEY", "MINIMAX_CN_API_KEY",
    -        )):
    -            check_ok("API key configured")
    +        if _has_provider_env_config(content):
    +            check_ok("API key or custom endpoint configured")
             else:
                 check_warn("No API key found in ~/.hermes/.env")
                 issues.append("Run 'hermes setup' to configure API keys")
    ```
  - `tests/hermes_cli/test_doctor.py`

    ```diff
    @@ -0,0 +1,17 @@
    +"""Tests for hermes doctor helpers."""
    +
    +from hermes_cli.doctor import _has_provider_env_config
    +
    +
    +class TestProviderEnvDetection:
    +    def test_detects_openai_api_key(self):
    +        content = "OPENAI_BASE_URL=http://localhost:1234/v1\nOPENAI_API_KEY=[redacted:secret-assignment]"
    +        assert _has_provider_env_config(content)
    +
    +    def test_detects_custom_endpoint_without_openrouter_key(self):
    +        content = "OPENAI_BASE_URL=http://localhost:8080/v1\n"
    +        assert _has_provider_env_config(content)
    +
    +    def test_returns_false_when_no_provider_settings(self):
    +        content = "TERMINAL_ENV=local\n"
    +        assert not _has_provider_env_config(content)
    ```
- **#623: fix(doctor): add custom endpoint connectivity check for OPENAI_BASE_URL**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#573`

## Fix status

- Merged to main in PR #573 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-03-08`. This confirmation is old and may be out of date (a revert/reopen would not have invalidated it here); re-verify.
- Subsystem: `hermes_cli`
