Check balance using that endpoint https://api.z.ai/api/monitor/usage/quota/limit
Check tokens using endpoint https://api.z.ai/api/monitor/usage/model-usage
Create a .env file (never upload it CONFIDENTIAL INFO) with ZAI_API_KEY="whateverthekeyis"
Run with python e.g. python balance.py
The time is YOUR localtime, not UTC
Not affiliated or endorsed by z.ai/GLM etc.
Output is as follow:
