--- name: zai-usage description: Query current Z.ai GLM Coding Plan quota and usage (5-hour/weekly credits, model tokens, MCP calls). Use when the user asks about their Z.ai usage, remaining credits, quota, or rate-limit status. --- Run the script once and report the result: ```bash bash ~/.pi/agent/skills/zai-usage/scripts/zai-usage.sh # last 24h window bash ~/.pi/agent/skills/zai-usage/scripts/zai-usage.sh 168 # last 7 days ``` - Credentials come from `~/.pi/agent/auth.json` (`zai.key`) — never print the key. - Endpoints: `api.z.ai/api/monitor/usage/{model-usage,tool-usage,quota/limit}` (same as Z.ai's Claude Code plugin). - Present 5-hour and weekly credits (used/remaining/reset) plus model token totals in a small table. - If the key is missing, tell the user to run `/login zai` in pi first.