Skip to content

Releases: LogicIncZo/zai-usage

v0.8.1

Choose a tag to compare

@srikanthlogic srikanthlogic released this 22 Sep 23:42

Fixes benefits / codingplan-benefits crashing with ReferenceError: perMonth is not defined (regression in v0.7.0 refactor — gatherBenefits() result was not awaited). Adds 2 spawn-mode regression tests (48 total).

v0.8.0: learned prices, estimates, runway, compare, export + docs site

Choose a tag to compare

@srikanthlogic srikanthlogic released this 21 Sep 13:06

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

Choose a tag to compare

@srikanthlogic srikanthlogic released this 21 Sep 10:53

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

Choose a tag to compare

@srikanthlogic srikanthlogic released this 21 Sep 04:18

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

Choose a tag to compare

@srikanthlogic srikanthlogic released this 21 Sep 01:39

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

Choose a tag to compare

@srikanthlogic srikanthlogic released this 10 Sep 10:40

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 month
  • fiveHourWindow() helper, unit-tested (25 tests)
  • README samples regenerated, published as zai-usage@0.4.0 on npm

v0.3.1

Choose a tag to compare

@srikanthlogic srikanthlogic released this 10 Sep 04:45

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

Choose a tag to compare

@srikanthlogic srikanthlogic released this 10 Sep 03:02
  • 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. --json emits {ok, left, used, callsLeft, resetsInMin}.
  • --help and --version work without an API key
  • 24 unit tests; agent-integration docs in README

v0.2.0

Choose a tag to compare

@srikanthlogic srikanthlogic released this 10 Sep 02:17
  • Timezone handling: reset times render in your system timezone; override with --tz <IANA zone> or standard TZ env (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.main so the script is importable for tests

zai-usage v0.1.0

Choose a tag to compare

@srikanthlogic srikanthlogic released this 10 Sep 00:42

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 packs
  • zai-usage usage [date] [--from --to] — hourly/daily buckets per model
  • --demo synthetic data (no API key), --color force ANSI, --json machine-readable

One-click install:

curl -fsSL https://raw.githubusercontent.com/LogicIncZo/zai-usage/main/install.sh | bash