- 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. SetzaiUsage.useIcon: falseto displayz.ai:as a text prefix instead.
- Get your API token from the z.ai API Key page
- Open the Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Run z.ai Usage: Set API Key and paste your token
- The status bar will update immediately
| 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 |
| 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: |
- VS Code 1.85.0 or higher
- A valid z.ai API token
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
