NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

[Bug] 使用claude模型时,调用后端缺失Authorization header

Open wyuc opened this issue 1 year ago • 6 comments

📦 Deployment Method

Vercel

📌 Version

2.15.3

💻 Operating System

Windows

📌 System Version

win11 23H2 22631.4169

🌐 Browser

Edge

📌 Browser Version

129.0.2792.79

🐛 Bug Description

使用OpenAI模型时,请求头中包含Authorization header,接口正常返回。 使用Claude系列模型时,请求头中无此header,导致401报错

{
  "error": true,
  "msg": "empty access code"
}

后端日志:

/api/anthropic/v1/messages
[Auth] hashed access code: xxx
Oct 08 15:29:14.98
POST
---
/api/anthropic/v1/messages
[Auth] got access code:
---
/api/anthropic/v1/messages
[POST] /api/anthropic/v1/messages?nxtPprovider=anthropic&nxtPpath=v1%2Fmessages st

📷 Recurrence Steps

选择Claude系列模型,发送消息,返回401报错

🚦 Expected Behavior

正常返回调用结果

📝 Additional Information

No response

wyuc avatar Oct 08 '24 07:10 wyuc

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] When using the claude model, the Authorization header is missing when calling the backend

Issues-translate-bot avatar Oct 08 '24 07:10 Issues-translate-bot

please test in v2.15.4

lloydzhou avatar Oct 09 '24 11:10 lloydzhou

please test in v2.15.4

still the same

wyuc avatar Oct 10 '24 14:10 wyuc

Is there any update on this issue?

hyiip avatar Oct 29 '24 19:10 hyiip

I found out the solution. After updating, we have to reset the Custom Endpoint for Anthropic, including endpoint, API key and API version and use environment variable.

hyiip avatar Oct 30 '24 18:10 hyiip

any news

peterwillcn avatar Mar 19 '25 10:03 peterwillcn