Skip to content

[Feature]: Link a GLM Coding Plan API key in AI Provider Accounts #23803

Description

@parkavenue9639

Problem or use case

Since #23520 the status bar can show the GLM Coding Plan quota, but the only credential source is the ZCode CLI's ~/.zcode/cli/config.json. Plenty of GLM Coding Plan subscribers (both the international Z.AI console and Zhipu's mainland BigModel platform) never install the ZCode CLI — they run GLM through Claude Code (ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic or https://open.bigmodel.cn/api/anthropic), OpenCode, or Cline. For them:

  • Settings → AI Provider Accounts has no GLM section at all (MiniMax has cookie + API key entry; GLM has nothing), so there is no way to link the plan from inside Orca.
  • The status-bar meter is also PATH-gated on the ZCode CLI, so even with credentials available there is no meter without the CLI installed.

Both sites expose the same quota endpoint (/api/monitor/usage/quota/limit, raw Authorization key), so one credential flow covers both — the user just has to pick which site their plan belongs to.

Proposed solution

Add a GLM Coding Plan section to Settings → AI Provider Accounts:

  • A site selector — Z.AI (z.ai) vs Zhipu BigModel (open.bigmodel.cn) — persisted like minimaxEndpoint.
  • An API key field stored through the existing per-provider safeStorage envelope pattern (MiniMax API-key store), never crossing IPC back to the renderer.
  • The saved key takes priority over ~/.zcode/cli/config.json, so the existing ZCode-CLI flow keeps working unchanged as a fallback.
  • Config-hash invalidation + fetch-generation guards mirror MiniMax, so switching site/key discards the stale snapshot instead of showing the other site's quota.
  • When a plan key is saved, the zcode status-bar meter is exempt from ZCode CLI PATH detection (same exemption MiniMax/Cursor already have), so the meter appears without the CLI.

Related: #18506 (status-bar quota, delivered by #23520), #7569 (broader custom-provider quota visibility).

Activity

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