Skip to content

j4rviscmd/vscode-zai-usage

Repository files navigation

VSCode z.ai Usage

Status bar example

Latest Release Last Commit License

Display your z.ai token usage percentage directly in the VS Code status bar

Features

  • Shows token quota usage (e.g. 45% (2h30m)) in the status bar
  • Displays time remaining until quota resets when available
  • Automatically refreshes at a configurable interval
  • Secure API key storage via VS Code Secret Storage

Status bar examples:

Situation Display
Authenticated, usage available ⬡ 45% (2h30m)
Authenticated, no reset time ⬡ 45%
API key not set ⬡ Set API Key
Error / fetch failed ⬡ -

The icon is the z.ai icon. Set zaiUsage.useIcon: false to display z.ai: as a text prefix instead.

Setup

  1. Get your API token from the z.ai API Key page
  2. Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  3. Run z.ai Usage: Set API Key and paste your token
  4. The status bar will update immediately

Commands

Command Description
z.ai Usage: Set API Key Enter and verify your z.ai API token
z.ai Usage: Clear API Key Remove the stored API token

Settings

Setting Type Default Description
zaiUsage.refreshInterval number 60 Data refresh interval in seconds
zaiUsage.useIcon boolean true Use z.ai icon () instead of text prefix z.ai:

Requirements

  • VS Code 1.85.0 or higher
  • A valid z.ai API token

License

Warning

This extension uses an internal z.ai API (api.z.ai/api/monitor/usage/quota/limit) which is not officially documented. The API may change without notice, which could break this extension.

MIT