360 Secure SkillHub
360 安全技能中心

Zai Usage

通过 shell 脚本调用 Z.AI 接口,读取本地 JWT 令牌对应的 GLM Coding Plan 用量:展示 5 小时与月度令牌额度、重置倒计时、Web 工具调用上限和订阅等级,并按占用比例给出状态图标,需要预先配置令牌环境文件。

1vecera
1vecera
热度 61.06
最近更新 2026-05-18 12:08:51
分类:数据依赖:代码执行 / 第三方 API / 读写文件应用场景:报告撰写 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add zai-usage
Metadata
name
zai-usage
version
1.1.0
description
Monitor Z.AI GLM Coding Plan usage and quota limits. Track token consumption, view reset times, and check subscription status.
author
openclaw
license
MIT
keywords
["z.ai","glm","usage","quota","monitoring","tokens"]
homepage
https://z.ai
repository
https://github.com/openclaw/skills

Z.AI Usage Monitor

Track your Z.AI GLM Coding Plan usage in real-time.

Quick Start

# Check usage
~/.openclaw/skills/zai-usage/scripts/usage-summary.sh

# Quick status
~/.openclaw/skills/zai-usage/scripts/quick-check.sh

Setup

  1. Get your JWT token from https://z.ai/manage-apikey/subscription

    • Open DevTools (F12)
    • Application → Local Storage → z-ai-open-platform-token-production
  2. Store in ~/.openclaw/secrets/zai.env:

    ZAI_JWT_TOKEN=eyJhbGci...
    

What You See

  • 5-Hour Quota - Rolling token usage with reset countdown
  • Monthly Quota - Monthly token allocation
  • Web Tools - Search/reader/zread call limits
  • Plan Level - Lite/Pro subscription status

Status Icons

Icon Usage
✅ < 50%
⚠️ 50-80%
🔴 > 80%

Commands

Ask me:

  • "How's our Z.AI usage?"
  • "Check credit usage"
  • "Are we running low on credits?"

Requirements

  • curl - HTTP requests
  • jq - JSON parsing
  • bc - Number formatting (optional)

Sources