WSL2 环境首次请求必现 401 invalid api key,重试成功,请求后端日志排查
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- backend-api-design
Research direction
The issue provides request and response examples for POST /v1/chat/completions and asks for backend authentication logs, but it names no repository files, tests, or implementation entry point. Start by reproducing the first-request 401 followed by a successful retry, then inspect backend logs for both requests and compare their authentication results. Done means identifying the cause of the first 401 and confirming whether the same behavior occurs for other new connections.
Written by the indexing model from the issue text.
Description
尊敬的 MiniMax 技术支持团队:
您好!我在使用 MiniMax API 时遇到一个稳定复现的问题,已自行排查但无法定位根因,恳请协助查询后端日志。
一、账号与环境信息
| 项目 | 值 |
|---|---|
| 平台 | 国内 MiniMax 开放平台 |
| GroupId | [请在此处填写你的 GroupId] |
| Endpoint | https://api.minimaxi.com/v1 |
| API Key 类型 | sk-api-*(按量付费) |
| 调用环境 | Windows 11 + WSL2 Ubuntu 22.04 |
| 客户端 | OpenClaw v2026.4.1(OpenAI-compatible 格式) |
| 使用模型 | MiniMax-M2.5 |
二、问题现象
核心问题: 每次新建连接后,首次请求必返回 HTTP 401,等待 2-5 秒后重试完全相同的请求即可成功(HTTP 200),后续调用持续正常。
| 请求次序 | HTTP 状态码 | 响应内容 | 结果 |
|---|---|---|---|
| 首次 | 401 | {"error": "invalid api key"} |
❌ 失败 |
| 重试(2-5 秒后) | 200 | {"choices": [...]} |
✅ 成功 |
| 后续调用 | 200 | 正常 | ✅ 成功 |
复现频率: 100%(每次新连接首次请求必现)
三、已排查内容
| 排查项 | 结果 |
|---|---|
| API Key 有效性 | ✅ 确认有效(重试后成功) |
| Endpoint 配置 | ✅ 国内平台使用 api.minimaxi.com,配置正确 |
| 请求格式 | ✅ 符合 OpenAI-compatible 规范 |
| 网络连通性 | ✅ 同一环境访问其他服务(如 aicodewith 中转)无此问题 |
| 客户端版本 | ✅ OpenClaw 已升级至最新版 v2026.4.1 |
四、请求与响应示例(已脱敏)
首次请求(失败):
POST /v1/chat/completions HTTP/1.1
Host: api.minimaxi.com
Authorization: Bearer sk-api-****(已脱敏)
Content-Type: application/json
{"model": "MiniMax-M2.5", "messages": [{"role": "user", "content": "hi"}]}
← HTTP/1.1 401 Unauthorized
{"error": "invalid api key"}
重试请求(成功):
← HTTP/1.1 200 OK
{"choices": [{"message": {"content": "Hello!"}}]}
五、初步技术分析(待官方确认)
我们推测可能的原因包括:
- TLS 握手超时导致首次请求被截断
- API Key 验证服务存在冷启动延迟
- 连接池预热问题
但以上均为猜测,需要后端日志协助确认。
六、诉求
恳请协助查询对应时间段的后端日志,确认:
- 401 请求到达后端时的具体鉴权失败原因(Key 无效?超时?其他?)
- 失败请求与成功请求的差异(如 IP、Header、Key 状态、处理时长等)
- 是否存在首次连接特殊处理逻辑(如冷启动、连接池预热等)
- Dominant language
- No language data
- Stars
- 588
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MiniMax-AI/MiniMax-M2.5
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
MiniMax-AI/MiniMax-M2.5#41 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 48/100
MiniMax-AI/MiniMax-M2.5#39 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
MiniMax-AI/MiniMax-M2.5#38 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MiniMax-AI/MiniMax-M2.5#37 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
MiniMax-AI/MiniMax-M2.5#36 · 3 comments ·
All issues in MiniMax-AI/MiniMax-M2.5
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
dsavransky/EXOSIMS#497 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dginev/latexml-oxide#1132 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EricZimmerman/evtx#281 ·
-
bugfix
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 3 days
-
ClickHouse: quantile is read as the exact Quantile, though ClickHouse's quantile is approximateOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day