Summary
The native Anthropic provider reads ANTHROPIC_API_KEY, but it does not honor an ANTHROPIC_BASE_URL override. That prevents SkillSpector from using Anthropic-compatible local or corporate gateways that expose the standard Anthropic Messages API shape at a private base URL.
The OpenAI provider already supports the equivalent pattern with OPENAI_BASE_URL, so this is an inconsistent provider configuration surface.
Current Behavior
With an environment like:
SKILLSPECTOR_PROVIDER=anthropic
ANTHROPIC_API_KEY=<local gateway key>
ANTHROPIC_BASE_URL=http://localhost:8317
SkillSpector still constructs ChatAnthropic with the hardcoded https://api.anthropic.com base URL. The local key is only valid against the local gateway, so LLM-backed scans and integration tests cannot use this provider path.
anthropic_proxy is a separate raw-predict provider that requires ANTHROPIC_PROXY_ENDPOINT_URL; it does not cover the standard Anthropic Messages API base-URL override case.
Expected Behavior
AnthropicProvider should read an optional ANTHROPIC_BASE_URL env var and pass it to ChatAnthropic, defaulting to https://api.anthropic.com when unset.
This would make the native Anthropic path match the OpenAI provider's override behavior while preserving the existing default for normal Anthropic users.
Root Cause Evidence
src/skillspector/providers/anthropic/provider.py currently:
- defines
ANTHROPIC_BASE_URL = "https://api.anthropic.com"
- reads only
ANTHROPIC_API_KEY in resolve_credentials()
- passes the constant
ANTHROPIC_BASE_URL into ChatAnthropic(...)
Proposed Scope
- Add optional
ANTHROPIC_BASE_URL support to the native Anthropic provider.
- Keep
ANTHROPIC_API_KEY as the credential env var.
- Keep the current default base URL when the override is unset.
- Add provider unit coverage for default and overridden base URL behavior.
Non-Goals
- No change to
anthropic_proxy raw-predict behavior.
- No new credential env var.
- No change to OpenAI or NVIDIA provider selection.
Summary
The native Anthropic provider reads
ANTHROPIC_API_KEY, but it does not honor anANTHROPIC_BASE_URLoverride. That prevents SkillSpector from using Anthropic-compatible local or corporate gateways that expose the standard Anthropic Messages API shape at a private base URL.The OpenAI provider already supports the equivalent pattern with
OPENAI_BASE_URL, so this is an inconsistent provider configuration surface.Current Behavior
With an environment like:
SkillSpector still constructs
ChatAnthropicwith the hardcodedhttps://api.anthropic.combase URL. The local key is only valid against the local gateway, so LLM-backed scans and integration tests cannot use this provider path.anthropic_proxyis a separate raw-predict provider that requiresANTHROPIC_PROXY_ENDPOINT_URL; it does not cover the standard Anthropic Messages API base-URL override case.Expected Behavior
AnthropicProvidershould read an optionalANTHROPIC_BASE_URLenv var and pass it toChatAnthropic, defaulting tohttps://api.anthropic.comwhen unset.This would make the native Anthropic path match the OpenAI provider's override behavior while preserving the existing default for normal Anthropic users.
Root Cause Evidence
src/skillspector/providers/anthropic/provider.pycurrently:ANTHROPIC_BASE_URL = "https://api.anthropic.com"ANTHROPIC_API_KEYinresolve_credentials()ANTHROPIC_BASE_URLintoChatAnthropic(...)Proposed Scope
ANTHROPIC_BASE_URLsupport to the native Anthropic provider.ANTHROPIC_API_KEYas the credential env var.Non-Goals
anthropic_proxyraw-predict behavior.