-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
API Error: 400 bad request: Authorization header is badly formatted #1867
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Self Checks / 自检
-
I have searched for existing issues, including closed ones.
我已搜索过已有的 Issue,包括已关闭的。
CC Switch Version / 版本号
版本 v3.12.3
Operating System / 操作系统
Windows
Related App / 涉及应用
Claude Code
Steps to Reproduce / 重现步骤
使用 cc-switch 接入 GitHub Copilot 订阅模型给 claude code使用时,出现以下错误:
API Error: 400 bad request: Authorization header is badly formatted
环境信息
- cc-switch 版本:v3.12.3
- 操作系统:Windows
- 代理端口:127.0.0.1:15721
已确认的情况
- ✅ GitHub Copilot 账号已登录(LittleSakura77)
- ✅ Copilot Token 未过期
- ✅ 代理服务正常运行
- ❌ 仍然出现 Authorization header 格式错误
日志信息
从 cc-switch 日志中看到代理有请求被拒绝:
rejection_type="axum::extract::rejection::MissingJsonContentType"
配置文件
providers 表中 GitHub Copilot 配置:
- ANTHROPIC_BASE_URL: https://api.githubcopilot.com
- ANTHROPIC_MODEL: GPT-5.4
copilot_auth.json:
{
"accounts": {
"68846244": {
"github_token": "ghu_xxx..."
}
}
}
### Expected Behavior / 期望行为
请问这个问题如何解决?或者是否有其他排查方式?
感谢!
### Actual Behavior / 实际行为
_No response_
### Additional Context / 补充信息
_No response_Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working