Skip to content

Anthropic provider ignores config.yaml model.base_url — base URL hardcoded after #1675 #1948

@rivercrab26

Description

@rivercrab26

Bug Description

After PR #1675 removed ANTHROPIC_BASE_URL env var support, the Anthropic provider base URL is hardcoded to https://api.anthropic.com in two places:

  1. hermes_cli/runtime_provider.py (line 313) — main runtime resolution
  2. agent/auxiliary_client.py _try_anthropic() (line 659) — auxiliary client

This makes it impossible to use Anthropic-compatible proxies (Sub2API, LiteLLM proxy, etc.) without modifying source code.

Expected Behavior

The Anthropic provider should respect model.base_url from config.yaml, consistent with how other providers (alibaba, custom, etc.) handle base URL overrides.

# config.yaml
model:
  provider: anthropic
  base_url: http://localhost:8080  # should be respected

Current Behavior

The base_url field is completely ignored for the Anthropic provider. It always resolves to https://api.anthropic.com.

Impact

Users who rely on Anthropic-compatible proxies for:

  • API key aggregation / load balancing (Sub2API, LiteLLM)
  • Cost tracking / rate limiting
  • Self-hosted proxy endpoints

...have no way to configure this without patching source code.

Suggested Fix

Read model.base_url from config.yaml as an override, falling back to https://api.anthropic.com when not set. This is a minimal, non-breaking change (2 files, ~20 lines).

PR: forthcoming

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