GLM Plan Usage
English Intro
状态栏中实时监控 GLM Coding Plan 的配额使用情况。支持 bigmodel.cn 和 Z.ai 平台。
功能特性
- 状态栏监控:实时显示 5 小时和周配额使用百分比,颜色随使用率变化
- 🟢 绿色:< 70%
- 🟡 黄色:70% ~ 89%
- 🔴 红色:≥ 90%
- 富文本提示:鼠标悬停显示详细配额信息和今日使用趋势图
- 今日统计:显示今日 Token 用量、调用次数、峰值数据
- 趋势图表:Unicode 柱状图展示今日每小时使用趋势
- 配额预警:使用率达到 90% 时自动弹出警告通知
- 自动刷新:可配置定时自动刷新配额数据
- 多平台支持:支持 智谱(cn) 和 Z.ai 平台
- 国际化:支持中文和英文界面
- 安全存储:API Key 使用操作系统级加密存储,不会明文写入配置文件
截图
状态栏

状态栏右侧显示合并指标:5h: XX.X% | Week: XX.X%
悬停显示

悬停提示包含:
- 更新时间
- 5 小时配额进度条及下次刷新时间(倒计时格式)
- 周配额进度条及下次刷新时间(倒计时格式)
- 今日统计:今日 Token、今日调用、峰值 Token、峰值调用
- 今日趋势:Unicode 柱状图展示每小时使用情况
配置
在设置中配置(Ctrl+,):
| 设置项 |
说明 |
默认值 |
glmPlanUsage.baseUrl |
API 地址,下拉选择 |
https://open.bigmodel.cn/api/anthropic |
glmPlanUsage.autoRefresh |
启动时自动刷新 |
true |
glmPlanUsage.refreshInterval |
自动刷新间隔(秒),0 为禁用 |
300 |
安全存储说明
API Key 已迁移至安全存储
- API Key 不再存储在
settings.json 文件中,而是使用 VS Code 的 SecretStorage API
- SecretStorage 利用操作系统密钥管理器进行加密存储(Windows Credential Manager / macOS Keychain / Linux libsecret)
- 你的 API Key 不会被同步到其他设备或 Git 仓库中
设置 API Key
推荐使用命令方式设置(加密存储,绝不写入文件):
- 打开命令面板(
Ctrl+Shift+P)
- 输入
GLM Plan Usage: 设置 API Key
- 在弹出的输入框中粘贴你的 API Key(输入框已启用密码模式,安全输入)
- 按 Enter 确认保存
⚡ 安全性说明:此命令使用 VS Code SecretStorage API,API Key 将通过操作系统密钥管理器加密存储,绝不会写入任何配置文件或 Git 仓库。
环境变量方式
你也可以通过环境变量 GLM_API_KEY 配置,这种方式在多个 VS Code 实例间共享,无需重复设置。
自动迁移
如果你之前在 settings.json 中配置过 API Key,升级到新版本后首次启动时,扩展会自动将 token 迁移到安全存储,并清空配置文件中的明文。
支持的 API 地址
| 平台 |
地址 |
| ZHIPU(智谱) |
https://open.bigmodel.cn/api/anthropic |
| ZHIPU 开发环境 |
https://dev.bigmodel.cn/api/anthropic |
| Z.ai |
https://api.z.ai/api/anthropic |
获取 API Key
使用方法
- 配置 Base URL(可选,默认已设置)
- 安全设置 API Key:命令面板(
Ctrl+Shift+P)→ GLM Plan Usage: 设置 API Key(加密存储)
- 或直接点击状态栏中的配额指标进行手动刷新
扩展会在启动时自动查询并定时刷新。
更新日志
1.3.0
- 安全性升级:使用 SecretStorage 优化 Auth Token 存储,提高安全性
- 性能优化:使用缓存机制,优化多窗口接口轮询
- 体验优化:优化倒计时显示,配额重置时间改为倒计时格式
- 安全存储:API Key 自动迁移到操作系统密钥管理器,绝不会写入配置文件
Introduction
Real-time monitoring of GLM Coding Plan quota usage in the status bar. Supports bigmodel.cn and Z.ai platforms.
Features
- Status Bar Monitoring: Real-time display of 5-hour and weekly quota usage percentages with color-coded indicators
- 🟢 Green: < 70%
- 🟡 Yellow: 70% ~ 89%
- 🔴 Red: ≥ 90%
- Rich Tooltip: Hover to view detailed quota information and today's usage trend chart
- Today Statistics: Display today's token usage, call count, and peak data
- Trend Chart: Unicode bar chart showing hourly usage trend for today
- Quota Warning: Automatic warning notification when usage reaches 90%
- Auto Refresh: Configurable automatic quota data refresh
- Multi-Platform Support: Supports ZHIPU (cn) and Z.ai platforms
- Internationalization: Supports Chinese and English interface
- Secure Storage: API Key is stored using OS-level encryption, never written in plain text
Screenshots
Status Bar

Combined indicator displayed on the right side of the status bar: 5h: XX.X% | Week: XX.X%

The tooltip includes:
- Updated time
- 5-hour quota progress bar with next reset time (countdown format)
- Weekly quota progress bar with next reset time (countdown format)
- Today Statistics: Today Tokens, Today Calls, Peak Token, Peak Calls
- Today Trend: Unicode bar chart showing hourly usage
Configuration
Configure in settings (Ctrl+,):
| Setting |
Description |
Default |
glmPlanUsage.baseUrl |
API URL, select from dropdown |
https://open.bigmodel.cn/api/anthropic |
glmPlanUsage.autoRefresh |
Auto refresh on startup |
true |
glmPlanUsage.refreshInterval |
Auto refresh interval (seconds), 0 to disable |
300 |
Secure Storage
API Key Migrated to Secure Storage
- API Key is no longer stored in
settings.json. It now uses VS Code's SecretStorage API
- SecretStorage leverages your OS keychain for encrypted storage (Windows Credential Manager / macOS Keychain / Linux libsecret)
- Your API Key won't sync to other devices or be committed to Git
Set API Key
Use the command to set your API Key (encrypted storage, never written to files):
- Open command palette (
Ctrl+Shift+P)
- Type
GLM Plan Usage: Set API Key
- Paste your API Key in the input dialog (password mode enabled for secure input)
- Press Enter to save
⚡ Security Note: This command uses VS Code SecretStorage API. Your API Key will be encrypted by the OS keychain manager and never written to any config file or Git repository.
Environment Variable
You can also configure via the GLM_API_KEY environment variable. This shares the key across multiple VS Code instances.
Automatic Migration
If you previously configured the API Key in settings.json, the extension will automatically migrate it to secure storage on first startup after updating, clearing the plaintext from your config file.
Supported API URLs
| Platform |
URL |
| ZHIPU |
https://open.bigmodel.cn/api/anthropic |
| ZHIPU Dev |
https://dev.bigmodel.cn/api/anthropic |
| Z.ai |
https://api.z.ai/api/anthropic |
Get API Key
- ZHIPU Platform: Login to open.bigmodel.cn, get it from the API Keys page
- Z.ai Platform: Login to z.ai, get it from account settings
Usage
- Configure Base URL (optional, default is pre-configured)
- Securely set API Key: Command palette (
Ctrl+Shift+P) → GLM Plan Usage: Set API Key (encrypted storage)
- Or click the quota indicator in the status bar directly for manual refresh
The extension will automatically query on startup and refresh periodically.
Changelog
1.3.0
- Security Enhancement: Migrated to SecretStorage for secure Auth Token storage
- Performance Optimization: Implemented caching mechanism to optimize multi-window API polling
- UX Improvement: Optimized countdown display format for quota reset times
- Secure Storage: API Key automatically migrated to OS keychain manager, never written to config files