Skip to content

/provider/v1/messages: 403 "Authentication failed" for claude-sonnet-5-5 and claude-haiku-5-5 only (auth passes for other models) #26

Open

Description

@esp32gallery

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=enabled with budget_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

  1. Return 403 MODEL_NOT_IN_PLAN for these two IDs (as you already do for claude-sonnet-5 / claude-opus-5) if they are not on the current plan; reserve 403 Authentication failed for requests whose credentials truly did not validate.
  2. Check why auth rejects these two model IDs specifically when other models pass on the same endpoint.
  3. 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: liuqing200kg@gmail.com (GitHub: @lqisgod). Happy to provide raw request/response captures or test further on our account.

Activity

  1. arjhinety commented on Oct 22, 2026

    @arjhinety

    Same signature now on the Meta Muse models, on /provider/v1/chat/completions and /provider/v1/responses.

    403 {"error":{"message":"Authentication failed. Please check your credentials.","type":"permission_error"}}

    Started 2026-10-22 ~18:35 UTC+8 (10:35 UTC), intermittent at first, then near-constant 20:24–21:01 UTC+8, recovered briefly ~21:04, failing again since 21:56 UTC+8 (13:56 UTC).

    Same key, single requests a few seconds apart, ~22:00 UTC+8 (14:00 UTC), max_tokens 16, prompt "hi", three rounds:

    model results
    meta/muse-spark-1.3-contributor 403, 403, 403
    meta/muse-spark-1.3 200, 403, 403
    meta/muse-spark-1.2-contributor 403, 403, 403 (200 one minute earlier)
    meta/muse-spark-1.2 403, 403, 403
    meta/muse-spark-1.1 403, 403, 403
    meta/muse-wonder-1.0 403, 403, 403
    meta/muse-spark-open 200, 200, 200
    minimax/minimax-m3.1-flash 200

    The key is valid and funded: the usage endpoint resolves the account, 5-hour and weekly limits are well under 50%, and non-Meta models return 200. A fresh login did not change anything. Load before the second onset was light (~50 requests in the preceding 50 minutes), so this does not look like per-user rate limiting.

    Because nearly every Meta-hosted model fails, both contributor and standard tiers, and it flips between 200 and 403 on identical requests, it looks like the upstream Meta credential (or one of several in a pool) is being rejected and the error is relayed as a client auth failure.

    Sample CF-RAY of a 403: a4e90729de9dacf8-HKG.

  2. linshenwuhai commented on Nov 17, 2026

    @linshenwuhai

    Same signature here — only claude-sonnet-5-5 and claude-haiku-5-5 fail, every other model on the same key works.

    Account: 20501013145a2u (PRO plan, $20/mo, active)

    Error body (identical on every retry):

    403 {"type":"error","error":{"type":"permission_error","message":"The provider refused this request. The refused request wasn't charged."}}
    

    Timeline (Asia/Shanghai, 2026-11-18):

    • 19:23 (Nov 17) → 02:24: claude-sonnet-5-5 worked — 16 successful requests, ~3.7M tokens
    • 00:57: claude-haiku-5-5 → 403
    • 02:24: last successful claude-sonnet-5-5 call
    • 02:25: claude-sonnet-5-5 → 403 (one minute after a success)
    • 03:05–03:15: 8 consecutive claude-sonnet-5-5 attempts → 403 ×8; claude-haiku-5-5 → 403 ×2

    Same key, same minute, to show auth itself is fine:

    request result
    POST /provider/v1/chat/completions deepseek/deepseek-v4.1-flash 200
    POST /provider/v1/chat/completions gpt-6.1-terra 200
    POST /provider/v1/messages claude-opus-5-5 403 MODEL_NOT_IN_PLAN ← auth passed
    POST /provider/v1/chat/completions claude-sonnet-5-5 400 "must be called via /messages" ← auth passed
    POST /provider/v1/messages claude-sonnet-5-5 403 provider refused
    POST /provider/v1/messages claude-haiku-5-5 403 provider refused

    Not a quota or plan gate — billing/usage at the time of failure:

    • Plan: PRO $20/mo, ACTIVE, monthly allowance 34% used (resets 2026-12-17)
    • Rolling windows: 5-hour 70%, weekly 68% (neither exhausted)
    • Premium-model allowance: 16 requests / 3.7M tokens ≈ 19% of the month's usage

    So: the key is valid, the plan is active and funded, other models on both endpoints return 200, and claude-opus-5-5 gets a normal business error (MODEL_NOT_IN_PLAN) on the very same endpoint — which means auth is evaluated and passing before those two model IDs are rejected.

    Looks like the same class of failure as the original report: specific Claude model IDs refused after auth, intermittently at first and then consistently. Happy to run any probe you need.

  3. Daemon-Stark-ZHAN commented on Nov 19, 2026

    @Daemon-Stark-ZHAN

    Same signature on a GOAT account, and a brand-new API key reproduces it consistently.

    Account: GOAT (individual-goat), subscription active (current period 2026-11-18 → 2026-12-18).
    Billing at the time of failure: monthly credits ~$63 remaining, 5-hour window 2.4 / 14, weekly window 6.9 / 35 — nowhere near a cap.

    Error body (identical on every retry, on both keys):

    403 {"type":"error","error":{"type":"permission_error","message":"The provider refused this request. The refused request wasn't charged."}}

    Same key, same minute:

    request result
    GET /provider/v1/models 200
    POST /provider/v1/chat/completions deepseek/deepseek-v4.1-flash-fast 200
    POST /provider/v1/chat/completions moonshotai/Kimi-K3.1-Pro 200
    POST /provider/v1/messages claude-opus-5-5 403 MODEL_NOT_IN_PLAN ← auth passed
    POST /provider/v1/messages claude-sonnet-5-5 403 provider refused
    POST /provider/v1/messages claude-haiku-5-5 403 provider refused

    The MODEL_NOT_IN_PLAN row is the point: it is an ordinary business error, so auth runs before
    the plan check and it passed. Auth therefore passes for claude-opus-5-5 but is refused for
    claude-sonnet-5-5, on the same endpoint with the same key.

    Timeline (America/Chicago, UTC-6):

    • 2026-11-17 21:35 — claude-sonnet-5-5 returned a normal answer. Last success I have.
    • 2026-11-18 20:52 → 21:28 — every claude-sonnet-5-5 call returns 403 (20+ attempts).

    Ruled out:

    • Key: a brand-new key created today behaves identically.
    • Plan / quota / billing: plan active, credits and both rolling windows far from their caps; every other model on the same key returns 200.
    • Request shape: non-stream and stream; max_tokens 16 → 2048; thinking: adaptive / absent; anthropic-version: 2023-06-01; Authorization: Bearer only, x-api-key only, and both; x-cmd-zdr: 1 and 0; User-Agent: claude-cli/2.1.0; system as string and as block array — all identical 403.
    • Wrong endpoint: claude-sonnet-5-5 on /provider/v1/chat/completions still answers the correct 400 Model "claude-sonnet-5-5" must be called via /provider/v1/messages.

    This looks like the same class of failure as the original report: two specific model IDs are
    refused after auth while everything else on the same key works. Could someone check the Anthropic
    forwarding pool behind /provider/v1/messages? This has been open since 2026-10-16 and is still
    reproducible today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions