/provider/v1/messages: 403 "Authentication failed" for claude-sonnet-5-5 and claude-haiku-5-5 only (auth passes for other models)
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
研究方向
The report identifies POST /provider/v1/messages and the affected model IDs, but it does not point to repository files, tests, or implementation entry points. Start by locating the handler and tracing its authentication and plan-check paths for these IDs. Done when valid credentials receive an appropriate response for both models and genuine credential failures remain distinguishable.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
POST https://api.commandcode.ai/provider/v1/messages returns HTTP 403 for two model IDs:
{"type":"error","error":{"type":"permission_error","message":"Authentication failed. Please check your credentials."}}
with model=claude-sonnet-5-5 and model=claude-haiku-5-5. The credentials are valid — auth passes for every other model on the same endpoint with the same key.
Started 2026-10-16 ~11:00 CST (03:00 UTC). Last success 10:59:51, first 403 11:00:30.
Evidence that this is server-side (auth is evaluated before the plan check, and passes)
Same key, same second, same User-Agent:
| request | result |
|---|---|
GET /alpha/billing/credits |
200, monthlyCredits 63.44 (key valid, funded) |
GET /provider/v1/models |
200, 92 models incl. claude-sonnet-5-5 |
POST /provider/v1/messages claude-sonnet-5 |
403 MODEL_NOT_IN_PLAN ← auth passed |
POST /provider/v1/messages claude-opus-5 |
403 MODEL_NOT_IN_PLAN ← auth passed |
POST /provider/v1/messages claude-sonnet-5-5 |
403 Authentication failed ← only these two |
POST /provider/v1/messages claude-haiku-5-5 |
403 Authentication failed |
POST /provider/v1/chat/completions claude-sonnet-5-5 |
400 "must be called via /messages" (auth passed) |
POST /provider/v1/chat/completions deepseek/deepseek-v4.1-flash |
200 (key fully works) |
The two MODEL_NOT_IN_PLAN rows are the point: they are ordinary business errors, so auth runs before the plan check and it passed. Auth therefore passes for claude-sonnet-5 but fails for claude-sonnet-5-5, on the same endpoint, same key — that is the inconsistency.
To Reproduce
KEY='user_...'
UA='claude-cli/2.1.300 (external, cli)'
# key valid & funded -> 200
curl -s -H "Authorization: Bearer $KEY" -H "User-Agent: $UA" \
https://api.commandcode.ai/alpha/billing/credits
# another model, SAME endpoint -> 403 MODEL_NOT_IN_PLAN (auth passed)
curl -s -X POST https://api.commandcode.ai/provider/v1/messages \
-H "Authorization: Bearer $KEY" -H "User-Agent: $UA" \
-H 'content-type: application/json' -H 'anthropic-version: 2023-06-01' \
-d '{"model":"claude-sonnet-5","max_tokens":16,"messages":[{"role":"user","content":"hi"}]}'
# the problem case -> 403 Authentication failed
curl -s -X POST https://api.commandcode.ai/provider/v1/messages \
-H "Authorization: Bearer $KEY" -H "User-Agent: $UA" \
-H 'content-type: application/json' -H 'anthropic-version: 2023-06-01' \
-d '{"model":"claude-sonnet-5-5","max_tokens":16,"messages":[{"role":"user","content":"hi"}]}'
Ruled out
- Bad key / out of credits: billing 200 ($63.44), deepseek 200, and business errors on the same endpoint. A genuinely exhausted key answers 400 "insufficient credits", not 403 (we have a second key on the account showing exactly that, so the two signatures are distinguishable).
- Rate limiting: reproduced with single requests 6–8 s apart, and again after a 3-minute cooldown.
- Request body / thinking shape: a 400 "Invalid input at thinking" appeared immediately before the first 403 in our logs, so we tested
thinking.type=enabledwithbudget_tokens,thinking.type=adaptive, and a plain body with no thinking. All three now return the same 403. - User-Agent:
claude-cli/2.1.300,magpie/0.1.1265, and Python-urllib give the identical 403. - Auth header shape:
Authorization: Bearer,x-api-key, and both together — identical 403. - Payload size: a 200 KB body behaves the same as a 40-byte body.
Impact
Beyond the two models being unusable via the Anthropic endpoint: the error text is indistinguishable from a real credential failure. Claude Code maps a 403 to "credentials rejected" and shows the login flow, so clients show /login repeatedly while the key is valid and funded, and users rotate perfectly good keys. Any client that auto-retries on 401/403 will also thrash.
What would help
- Return
403 MODEL_NOT_IN_PLANfor these two IDs (as you already do forclaude-sonnet-5/claude-opus-5) if they are not on the current plan; reserve403 Authentication failedfor requests whose credentials truly did not validate. - Check why auth rejects these two model IDs specifically when other models pass on the same endpoint.
- If this was an intentional plan change at ~03:00 UTC on 2026-10-16, a changelog line and a distinct error code would save people from debugging credentials that were never broken.
Account: [email protected] (GitHub: @lqisgod). Happy to provide raw request/response captures or test further on our account.
- 主要語言
- CSS
- 星號
- 7
- 分支
- 0
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
相似的 Issue
-
dropIndexes by key pattern panics on a shorter pattern and drops the wrong index on a longer one未關閉
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
mega-yfue/ha-eufy-sdk-bridge#198 ·
維護者通常 1 天內回覆
-
bug good first issue
難度 2/5 1-3 小時 新手友好度 85/100
qte77/agentic-job-offer-to-application-kit#487 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
btclib-org/btclib-wallet#801 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 2 天內回覆