Skip to main content

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 on check-llm-quota — uvx zai-quota keeps working unchanged. For new installs use uvx 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 uvx or pip

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)

  1. --key CLI argument
  2. ZAI_API_KEY environment variable
  3. ~/.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

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)

Source distribution for zai-quota 1.3.0
File Size Uploaded
zai_quota-1.3.0.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zai-quota 1.3.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page