Repository navigation
Releases
v0.1.2
agentstat 0.1.2
Patch release with dependency fixes, patch updates, and performance improvements.
Changes
- Dependency fixes and patch updates (
tokio,nix,icu_normalizer) - Performance improvements
- Refresh repository metadata and links for the
d5v7GitHub account
Install
cargo add agentstat@0.1.2v0.1.1
Highlights
agentstat 0.1.1 adds OpenCode Go account quotas and local OpenCode CLI activity, expands OpenCode Zen and Ollama usage reporting, and improves documentation and release checks.
OpenCode CLI activity
- Enable the opt-in
opencode-localfeature to read 30-day session statistics from the installed OpenCode CLI on Unix. - Newer CLI versions provide structured token counts, recorded USD cost, and per-model details. Older versions fall back to rounded text totals and return an
IncompleteDatawarning. - Local statistics cover the CLI's recorded sessions across providers. Free-model sessions can still report tokens with zero recorded model cost. This source does not report account quota, remaining credits, or balance.
OpenCode Go and Console
- The
opencodegoadapter accepts an OpenCode Go API key and reports five-hour, weekly, and monthly utilization percentages and reset times. - The Console cookie adapter can include a Zen prepaid balance alongside a Go subscription's quota when optional data is requested. Confirmed pay-as-you-go accounts continue to report 30-day spend and prepaid balance when available.
Ollama Cloud
- Report the included monthly USD credit window and reset for current plans, or session and weekly percentage windows for legacy plans, together with the purchased-credit balance when reported.
Getting started
cargo add agentstat@0.1.1For local OpenCode CLI statistics, enable opencode-local, opt in to local probes through Client::builder().allow_local_probes(true), and request ProviderId::OpenCode with Credentials::None and Source::LocalProbe. From a source checkout, the example can be run with:
cargo run --features opencode-local --example real_usage -- opencode-cliSee the usage guide for credentials and examples, and provider coverage for available data and restrictions.
Other changes
- Improved legacy OpenCode CLI number parsing to avoid reporting malformed or locale-dependent counts as valid usage.
- Added OpenCode live-test entry points and expanded synthetic fixtures, including free-model and legacy CLI cases. Live OpenCode account tests require explicit credentials and are ignored by default.
- Refreshed the README, provider coverage, roadmap, contribution guidance, and release documentation.
- Added Google Rust Style Guide checks and updated dependencies, including TLS-related security updates.
Provider APIs and private response formats can change. Fixture tests do not guarantee live-account compatibility; compare results with the provider's own usage page.
Full changelog: v0.1.0...v0.1.1
v0.1.0
agentstat v0.1.0
Initial release of the Rust library for reading AI account usage, quota windows, balances, spend, and reset times.
- 41 implemented provider integrations, including Codex, Claude, OpenCode, Cursor, and Antigravity.
- One async API with typed results, exact decimal amounts, and bounded batch fetching.
- Optional local credential reads and CLI usage probes.
- Provider configuration validation and explicit errors for malformed cost reports.
Provider adapters have fixture coverage. Live account compatibility has not been verified for every provider; compare results with the provider’s own usage page before relying on them.