繁體中文

問題修復

自訂閘道連線修復,未公開變數不再誤擋請求

如果你透過代理伺服器(替使用者轉發請求的中繼主機)連線 Claude,在 2.1.265 版可能遇到請求全部失敗。這是因為未記載的環境變數(開程式前預先設定的控制參數) CLAUDE_CODE_USE_GATEWAY 出現回歸異常。過去除非同時設定 ANTHROPIC_BASE_URL 與 ANTHROPIC_AUTH_TOKEN,否則它會被忽略;前一版卻單獨強制要求雲端閘道登入,導致搭配一般 API 金鑰、apiKeyHelper 或自訂標頭時每次請求都失敗。現在 2.1.266 版已修復,單獨存在時再次被忽略,你無須修改任何設定即可正常使用。

# 2.1.265 曾因單獨設定此未公開環境變數而強制要求雲端閘道登入:
export CLAUDE_CODE_USE_GATEWAY=true

# 過去與現在:除非同時設定以下兩者,否則該變數會被忽略:
export ANTHROPIC_BASE_URL="https://gateway.example.com"
export ANTHROPIC_AUTH_TOKEN="your-token"

# 搭配以下任一驗證時,前一版每次發出請求都會報錯:
# 1. API 金鑰(API key)
# 2. apiKeyHelper
# 3. 自訂驗證標頭(custom auth headers)
# 錯誤:Not signed in to the Cloud gateway

English

BUGFIX

Custom gateway connection fixed, undocumented variable no longer falsely blocks requests

If you connect to Claude through a proxy server, all your requests may have failed in version 2.1.265. This was caused by a regression with the undocumented environment variable CLAUDE_CODE_USE_GATEWAY. Previously, it was ignored unless both ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN were set; however, the previous version forced Cloud gateway sign-in on its own, causing every request to fail when paired with a standard API key, apiKeyHelper, or custom auth headers. Version 2.1.266 has now fixed this so the variable is ignored again when set alone, allowing normal use without changing any settings.

# In 2.1.265, setting this undocumented environment variable alone forced Cloud gateway sign-in:
export CLAUDE_CODE_USE_GATEWAY=true

# Previously and now: the variable is ignored unless both of the following are set:
export ANTHROPIC_BASE_URL="https://gateway.example.com"
export ANTHROPIC_AUTH_TOKEN="your-token"

# When paired with any of the following authentication methods, the previous version errored on every request:
# 1. API key
# 2. apiKeyHelper
# 3. Custom auth headers
# Error: Not signed in to the Cloud gateway

原始 CHANGELOG

Original changelog自訂閘道連線修復,未公開變數不再誤擋請求
Fixed a 2.1.265 regression affecting LLM-gateway and proxy setups: the undocumented `CLAUDE_CODE_USE_GATEWAY` environment variable, previously ignored unless `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` were both set, began forcing Cloud-gateway sign-in on its own in 2.1.265, so configurations that set it alongside an API key, `apiKeyHelper`, or custom auth headers failed every request with "Not signed in to the Cloud gateway". The variable on its own is ignored again; no configuration change is needed