zai-quota
⚠️ Merged into
check-llm-quota. This repo is archived. As of v1.3.0 the PyPI package is a thin shim that depends oncheck-llm-quota—uvx zai-quotakeeps working unchanged. For new installs useuvx check-llm-quota zai. All further development happens in the unified repo.
Check your Z.ai (Zhipu AI / 智谱AI) GLM API usage quota, remaining sessions, and token limits.
- Standalone CLI: Single Python file, zero dependencies
- Agent Skill: Install across 45+ AI agents via
npx skills - Python Tool: Install via
uvxorpip
Quick Start
As a standalone script
curl -O https://raw.githubusercontent.com/SeeYangZhi/zai-quota/main/zai_quota.py
ZAI_API_KEY=your_key python3 zai_quota.py
As an agent skill
npx skills add SeeYangZhi/zai-quota
Works with Claude Code, Codex, OpenCode, Cursor, Windsurf, Gemini CLI, and 45+ agents.
As a Python tool
# With uv
uvx zai-quota
# With pip
pip install zai-quota
zai-quota
Standalone Usage
# Environment variable
export ZAI_API_KEY="your_api_key_here"
python3 zai_quota.py
# CLI argument
python3 zai_quota.py --key "your_api_key_here"
# JSON output
python3 zai_quota.py --json
# List supported models + availability check
python3 zai_quota.py --models
# Force a specific endpoint
python3 zai_quota.py --endpoint cn # China (open.bigmodel.cn)
python3 zai_quota.py --endpoint intl # International (api.z.ai)
Skill Usage
Once installed via npx skills add SeeYangZhi/zai-quota, compatible agents will load this skill automatically when you ask things like:
- "Check my zai quota"
- "How much GLM API usage do I have left?"
- "What's my Zhipu quota?"
The agent will run:
python3 skills/zai-quota/scripts/check_quota.py
API Key Sources (in priority order)
--keyCLI argumentZAI_API_KEYenvironment variable~/.hermes/auth.json(if you use Hermes Agent)
Output Example
Z.ai GLM Quota
Plan: Lite
-------------------------------------
[green] Time Limit
Used: 0% | Remaining: 100
- search-prime: 0
- web-reader: 0
- zread: 0
Resets: 2026-04-16 10:31 SGT
[green] Tokens
Used: 18%
Resets: in 3h
-------------------------------------
How It Works
Calls the Z.ai monitoring API to fetch your current quota usage. Supports two endpoints:
- International:
api.z.ai(default, tried first) - China:
open.bigmodel.cn(fallback)
Note: This uses an unofficial monitoring endpoint. It works today but Z.ai could change it without notice.
Requirements
- Python 3.6+
- A Z.ai API key (from z.ai or open.bigmodel.cn)
Repository Structure
├── zai_quota.py # Standalone script (root-level)
├── pyproject.toml # uv/pip packaging
├── skills/
│ └── zai-quota/
│ ├── SKILL.md # Agent Skills spec
│ └── scripts/
│ └── check_quota.py # Skill entrypoint
├── README.md
└── LICENSE
For maintainers
make sync # Copy zai_quota.py into skills/zai-quota/scripts/
make verify-sync # CI check that both copies are identical
make build # uv build
make publish # uv build + uv publish to PyPI
License
MIT
Metadata
Release files for zai-quota 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zai_quota-1.3.0.tar.gz | 8.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zai_quota-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.2 kB
Release files / zai_quota-1.3.0.tar.gz
| Download URL | zai_quota-1.3.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74006dda41fcf93f7deb2090e990dfc970db042e86ba4899bfcf8ce1f91d1ce2
|
|
BLAKE2b-256 checksum How to use checksums |
00cce00b2a5c495a693ff3b86453e874bfc95558fce984be6dc20174d65f3faa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / zai_quota-1.3.0-py3-none-any.whl
| Download URL | zai_quota-1.3.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cd0bad81d9946f0ccf35df7c0c3e9ed211db9ab29b25a196b66b68a299272d2
|
|
BLAKE2b-256 checksum How to use checksums |
75146cd87b6ed95a50fd22ed16165c4e18eb1922ebe366ef5e215da60bb8e251
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency log