Releases: LogicIncZo/zai-usage
Release list
v0.8.1
v0.8.0: learned prices, estimates, runway, compare, export + docs site
New modes: prices (price table learned from your own billing ledger), estimate (cost a hypothetical workload at those prices, K/M/B suffixes), runway (burn-rate projections), compare (two accounts side by side), export (CSV/JSONL ledger for DuckDB). GitHub Pages docs site: https://logicinczo.github.io/zai-usage/ — 46 tests.
v0.7.0: behavioral insights — how was your week/month
New week and month modes: current span vs previous (tokens, calls, cache share, output share, list value, active days), 8 deterministic tip rules (pack expiry, peak-window burn, cache drop, premium-model drift, many-small-turns, single-day concentration, output spike, month pace), and a default GLM AI coach that reads aggregate metrics + fired tips and returns a verdict with up to 3 actions. --no-ai opts out (deterministic, free); --ai <model> picks the coach. Aggregates only are ever sent — no prompts or code. 42 tests.
v0.6.0: codingplan-benefits
New codingplan-benefits (alias benefits): scans every billing month since 2025-01 (--since YYYY-MM overrides) and prints lifetime plan value — list-price spend vs what you paid, plan-covered %, tokens/calls, cache savings, biggest month. --json returns the per-month breakdown. 34 tests.
v0.5.0: bill mode — day-level billing insights
New bill [YYYY-MM] mode reading the platform billing ledger (/api/platform-charge-zai/bill/day): list-price spend, plan-covered value, prompt-cache savings, blended $/1M tokens, peak day, MoM. customerId auto-discovered; paginated; --json + --demo supported. 31 tests.
v0.4.0 — 5-hour window per-model tokens
The model usage matrix now leads with a 5h Quota column: per-model tokens used inside the current 5-hour quota window (derived from nextResetTime − 5h → now, queried against the intraday model-usage range).
summary/summary --json: 6 window columns — 5h Quota, Hour, 24h, 7d, 30d, current monthfiveHourWindow()helper, unit-tested (25 tests)- README samples regenerated, published as
zai-usage@0.4.0on npm
v0.3.1
npm package refresh: README with npm/bunx install instructions ships in the tarball. Also on npm: https://www.npmjs.com/package/zai-usage
v0.3.0 — agent-friendly
zai-usage check: machine gate for agent runtimes — exit 0 when quota left ≥--min% (default 10), 1 when low, 2 on error. Windows:5h(default),monthly-tools,weekly.--jsonemits{ok, left, used, callsLeft, resetsInMin}.--helpand--versionwork without an API key- 24 unit tests; agent-integration docs in README
v0.2.0
- Timezone handling: reset times render in your system timezone; override with
--tz <IANA zone>or standardTZenv (bucket labels stay UTC+8 — that's the API's protocol) - Test suite:
bun test— 18 tests over pure helpers (human tokens, progress bar, UTC+8 stamping, peak-window detection, month windows vs the 31-day API cap, table alignment with ANSI, demo fixtures) - CLI dispatch guarded behind
import.meta.mainso the script is importable for tests
zai-usage v0.1.0
First release.
zai-usage— quota: colored 5-hour progress bar, monthly tool calls, reset times (IST)zai-usage summary— model usage matrix (Hour / 24h / 7d / 30d / current month), quota, reset packszai-usage usage [date] [--from --to]— hourly/daily buckets per model--demosynthetic data (no API key),--colorforce ANSI,--jsonmachine-readable
One-click install:
curl -fsSL https://raw.githubusercontent.com/LogicIncZo/zai-usage/main/install.sh | bash