glm-usage-monitor

# GLM Usage Monitor **Track your Z.AI / ZHIPU GLM Coding Plan usage live — in your toolbar.** [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Manifest v3](https://img.shields.io/badge/manifest-v3-blue.svg)](manifest.json) [![Chrome ≥116](https://img.shields.io/badge/Chrome-%E2%89%A5116-success.svg)](https://developer.chrome.com/docs/extensions/mv3/intro/) [![No dependencies](https://img.shields.io/badge/dependencies-0-green.svg)](#) [![No tracking](https://img.shields.io/badge/telemetry-none-brightgreen.svg)](SECURITY.md) GLM Usage Monitor popup showing 5-hour and weekly token windows, MCP usage, and 24-hour model and tool stats The 5-hour and weekly token windows · monthly MCP quota · reset countdowns · 24-hour model & tool usage — with a color-coded toolbar badge. The live usage monitor `claude-monitor.com` gives Claude users, for the **GLM Coding Plan**.

Why

If you use GLM via Claude Code (or any Coding Plan client) and missed having a live usage badge, this is for you. The extension reads your own usage from the official Z.AI / ZHIPU monitor API and shows it one click away.

The one catch: the Claude monitor needs no key — it rides your claude.ai session cookie. GLM’s usage API is not cookie-authed: it requires an Authorization: <token> header with your Coding Plan key. So you paste that key once, and it never leaves your device except to authenticate your own usage requests. See SECURITY.md for the full threat model.

Features

Install

Once published: open the listing in Brave / Chrome / Edge → Add to …, then open the extension → Settings → paste your key.

(Listing link will be added here once the extension is live.)

Load unpacked (for contributors / pre-release)

  1. Open your browser’s extensions page and enable Developer mode (Brave brave://extensions · Chrome chrome://extensions · Edge edge://extensions).
  2. Load unpacked → select the repo root (the folder with manifest.json).
  3. Pin the GLM Usage icon to your toolbar.

Set up your key

  1. Open the extension → ⚙ Settings.
  2. Paste your GLM Coding Plan API key — the same value you set as ANTHROPIC_AUTH_TOKEN when running Claude Code against GLM. Find it in your Z.AI dashboard under API Keys / Coding Plan.
  3. Platform — leave Z.AI — Global (api.z.ai) unless your account is on the China platform, then pick ZHIPU (open.bigmodel.cn).
  4. Test connection — you should see Connected — plan <tier>, 5h …%, weekly …%.
  5. Save. The badge updates within a few seconds.

How it works

A Manifest V3 service worker polls the monitor API on a timer and persists a normalized snapshot to chrome.storage.local; the popup just renders that snapshot. All values are written with .textContent, never innerHTML, so a malformed or hostile response cannot inject markup.

Three read-only GET endpoints are used (Auth header = your key, no Bearer prefix):

Endpoint Provides
/api/monitor/usage/quota/limit 5h %, weekly %, MCP %, plan tier, reset times
/api/monitor/usage/model-usage?startTime&endTime 24h tokens + call count
/api/monitor/usage/tool-usage?startTime&endTime 24h search / read / ZRead counts

Privacy & security

Full details: SECURITY.md · Privacy Policy

Troubleshooting

Contributing

Contributions are welcome! There is no build step and no dependencies — the JS in the repo is exactly what runs. See CONTRIBUTING.md for dev setup, the validation checks, and conventions. Please note the Code of Conduct.

Good first areas: more time-window breakdowns, new platform support, locale/i18n, and UI polish.

Acknowledgments

License

MIT © GLM Usage Monitor contributors