[BUG] Subscription auth (Pro/Max) ignores ANTHROPIC_BASE_URL — requests never reach custom proxy (LiteLLM)

Status Open
Reported on v2.1.246
Maintainer reply None cached
Activity 0 comments · opened Sep 3, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code should route all requests through the configured ANTHROPIC_BASE_URL,
regardless of auth method — the same way it does when using an API key. With
subscription-based auth (Pro/Max), it should still respect this setting and send
requests to the custom proxy (LiteLLM in our case) instead of bypassing it entirely.

What Should Happen?

Claude Code should route all requests through the configured ANTHROPIC_BASE_URL,
regardless of auth method. With subscription-based auth (Pro/Max), it should still
respect this setting and send requests to the custom proxy (LiteLLM in our case)
instead of bypassing it entirely.

Error Messages/Logs

No error is thrown — Claude Code runs normally with no visible failure. 
The issue is that no requests appear in LiteLLM's logs at all, confirming 
Claude Code is not sending traffic to the configured ANTHROPIC_BASE_URL.

LiteLLM logs confirm the proxy itself is up and working correctly when 
tested directly (e.g., via curl) — it simply never receives anything from 
Claude Code.

Steps to Reproduce

  1. Set up a LiteLLM proxy locally/remotely and confirm it's running and reachable

(e.g., via a direct curl request to the proxy endpoint).

  1. Configure Claude Code's settings.json with:

ANTHROPIC_BASE_URL=<your LiteLLM proxy URL>

  1. Ensure Claude Code is authenticated via subscription (Pro/Max) — not an API key.
  1. Run any normal Claude Code command/session (e.g., claude "explain this file").
  1. Check LiteLLM's logs.

Expected: The request should appear in LiteLLM's logs, since ANTHROPIC_BASE_URL
is configured to route traffic through it.

Actual: No request ever appears in LiteLLM's logs. Claude Code completes the
session normally, but traffic never reaches the proxy — as if ANTHROPIC_BASE_URL
is being ignored entirely when using subscription-based auth.

Note: We confirmed LiteLLM itself works correctly — testing it directly with
curl shows it responding as expected. The issue is isolated to Claude Code not
sending requests to it in the first place.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.246

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Relevant settings.json config (secrets redacted):

model_list:

  • model_name: claude

litellm_params:
model: anthropic/claude-sonnet-4-5-20250929

general_settings:
forward_client_headers_to_llm_api: true

litellm_settings:
master_key: "sk-REDACTED"

LiteLLM proxy logs confirm it is running and reachable — a direct curl request
to the proxy returns a valid response. However, no request from Claude Code
ever appears in these logs during an active Claude Code session, even though
Claude Code itself functions normally (responds, completes tasks, etc.) —
suggesting it's silently falling back to the default Anthropic endpoint
instead of respecting ANTHROPIC_BASE_URL.

We suspect Claude Code may only respect ANTHROPIC_BASE_URL when using
API-key-based auth, and silently ignores it under subscription-based
(Pro/Max) auth — but we couldn't find this documented anywhere, hence
this report.

Happy to share more of our LiteLLM config or logs if useful for debugging.

View original on GitHub ↗