From 3a0d92b622a3c67b8d7355382f7b023579750a76 Mon Sep 17 00:00:00 2001 From: kdletters <61648117+kdletters@users.noreply.github.com> Date: Fri, 2 Oct 2026 16:14:56 +0800 Subject: [PATCH] =?UTF-8?q?Anthropic=20=E7=9B=B4=E9=80=9A=E5=8F=AA?= =?UTF-8?q?=E7=94=A8=20x-api-key=20=E5=87=BA=E7=A4=BA=20Router=20=E5=87=AD?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - llm:原生 Anthropic 直通不再同时带 Authorization: Bearer,只发 Anthropic 规范的 x-api-key - 实测:Router 对同一次 /v1/messages 请求,只带 x-api-key 时 200(4.7s 返回真实回复),同时带 Bearer 时 79 秒后被断开 --- server-rs/crates/api-server/src/llm/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/server-rs/crates/api-server/src/llm/mod.rs b/server-rs/crates/api-server/src/llm/mod.rs index 94f3be0bd..351ffbb52 100644 --- a/server-rs/crates/api-server/src/llm/mod.rs +++ b/server-rs/crates/api-server/src/llm/mod.rs @@ -606,7 +606,6 @@ pub async fn proxy_llm_messages( let mut native_request = client .post(router_protocol_url(&base_url, "messages")) .header("x-api-key", api_key.clone()) - .bearer_auth(api_key.clone()) .header("content-type", "application/json"); for name in ["anthropic-version", "anthropic-beta", "accept"] { if let Some(value) = headers.get(name) {