Skip to content

fix(providers): guide Coding Plan keys to the Anthropic endpoint their quota lives on #1069

Open

Description

@yudongyouqing

Summary

One root problem for a GLM Coding Plan subscriber on first run, reproduced on a fresh raven web today (macOS arm64, main 43159933): the plan's quota lives on the Anthropic-compatible endpoint, and nothing tells the user that.

The default model resolves to bigmodel/glm-5.3-flash, which LiteLLM sends to the zai/bigmodel pay-as-you-go endpoints. The key is the same account in both cases; what differs is the billing track inside it: a Coding Plan's quota is consumed only through the Anthropic-compatible endpoint (https://open.bigmodel.cn/api/anthropic), while the chat-completions endpoints check the pay-as-you-go balance, which is zero. So the same key answers ZaiException - 余额不足或无可用资源包,请充值 / Insufficient balance or no resource package. Please recharge. on one track while its other track is full -- and nothing in onboarding or the docs distinguishes a plan key from pay-as-you-go credit, so the message reads as "your money is gone."

The dead end this misdirection leads to: following the balance message, the natural next move is to edit the bigmodel provider entry's baseURL to /api/anthropic. A provider's protocol does not follow its URL -- the entry still speaks OpenAI (chat/completions through LiteLLM), the Anthropic endpoint closes the stream immediately, and every retry logs the stream ended without the upstream's terminal chunk after 0s, surfacing as Error calling LLM (network): the model's reply was cut off by the connection. An anthropic-type provider entry with the same URL and key works immediately, which is the actual fix -- but a deterministic mismatch reported as a transport failure sends the user debugging sockets instead of finding it.

Steps to reproduce

  1. raven web with a GLM Coding Plan key configured and the default model (bigmodel/glm-5.3-flash); send 你好 in a new conversation.
  2. Observe the balance refusal from the pay-as-you-go endpoint (~/.raven/logs/gateway.log):
    09:59:20  Iteration 1/40 model=bigmodel/glm-5.3-flash
    09:59:25  Stream LLM error [rate_limit]: ZaiException - 余额不足或无可用资源包,请充值。
    
  3. In Settings, edit the bigmodel provider's baseURL to https://open.bigmodel.cn/api/anthropic and send 你好 again:
    10:17:08  Iteration 1/40 model=bigmodel/glm-5.3-flash
    10:17:10  the stream ended without the upstream's terminal chunk after 2s (0 chars ...)
    10:17:56  Error calling LLM (network): the model's reply was cut off by the connection
    
  4. Create an anthropic-type provider with that same URL and key: the turn completes.

Expected behavior

  • The onboarding wizard and the providers docs say which endpoint each credential kind works with: a Coding Plan key belongs on an Anthropic-protocol provider pointed at /api/anthropic; pay-as-you-go keys belong on the bigmodel/zai entries.
  • Along the way, so the dead end stops hiding the fix: a provider whose protocol cannot parse the endpoint's answer reports a protocol mismatch rather than a connection cut, or the settings probe catches it before a turn is spent on it.

Environment

macOS arm64, Raven main at 43159933, default model glm-5.3-flash, LiteLLM routing to provider = zai; log lines quoted from ~/.raven/logs/gateway.log on 2026-10-23.

Activity

  1. changed the title [-]fix(providers): guide Coding Plan keys to the Anthropic endpoint, and name the protocol mismatch a baseURL swap causes[/-] [+]fix(providers): guide Coding Plan keys to the Anthropic endpoint their quota lives on[/+] on Oct 23, 2026
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