Skip to content

Usage/rate-limit tracking for ZCode (Z.ai GLM Coding Plan)? #21757

Description

@sunganhao8-lgtm

Follow-up from #21756 (ZCode as a supported agent).

Orca's usage providers cover Claude, Codex, Gemini, OpenCode Go, Kimi, Antigravity, MiniMax, and Grok. ZCode (Z.ai's GLM Coding Plan CLI) is missing from that list — for subscribers it's the same kind of subscription worth surfacing in the status bar.

What I found while looking into this

  • The desktop bundle carries internal endpoints for plan billing (zcode.z.ai/api/v1/zcode-plan/billing/current and …/billing/balance), but no documented public usage API for third-party callers that I could find (docs.z.ai/devpack only points at the web billing console).
  • The CLI stores coding-plan credentials locally (e.g. ~/.zcode/v2/credentials.json, structure varies by plan: zai-coding-plan vs bigmodel-coding-plan).

So the Kimi pattern (read the CLI's own credentials file → call the CLI's own managed-usage endpoint) doesn't transfer 1:1 yet, and I didn't want to ship a fetcher against an undocumented internal endpoint in a drive-by PR.

Possible paths

  1. ZCode CLI exposes a stable usage/quota command or endpoint that Orca could call with the CLI's own credentials (cleanest — same shape as Kimi).
  2. Z.ai documents a public usage endpoint for the coding plan.
  3. As a last resort, the MiniMax-style cookie/console integration.

Happy to contribute the provider once there's agreement on which path is acceptable.

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