Skill: Z.ai Quota Checker
Check your Z.ai (Zhipu AI) GLM API quota and usage statistics.
Usage
/skill zai-quota check
Options
- •
--force: Force refresh, bypass cache - •
--threshold <n>: Alert threshold percentage (default: 20)
Output
Quota status for sessions, MCP calls, and time limits with visual indicators.
Implementation
This skill uses the zai-quota CLI tool which reads API keys from OpenCode's ~/.local/share/opencode/auth.json file.
Configuration
To use this skill, you need to configure your Z.ai API key in one of two ways:
- •
Via OpenCode CLI:
bashopencode connect # Select "Z.ai (Zhipu AI)" and enter your API key
- •
Manually edit auth.json:
bash# Edit OpenCode's auth file nano ~/.local/share/opencode/auth.json # Add your Z.ai key: { "provider": { "zhipuai": { "apiKey": "your_api_key_here" } } } - •
Set environment variable (fallback):
bashexport ZAI_API_KEY=your_api_key_here
The skill will automatically search for API keys in this order:
- •OpenCode's
~/.local/share/opencode/auth.json(primary) - •Environment variables
- •Direct
--api-keyoption