Skip to content
Dhanush edited this page Oct 23, 2026 · 2 revisions

agentstat wiki

agentstat is a Rust library for reading provider-reported AI account usage, quota windows, balances, spend, and reset times through one async API. Your application decides when to fetch and how to display or store the result.

Version guide: 0.1.0 is the published crate. The repository's main branch contains newer adapters and behavior, including OpenCode Go. Use a path dependency to try those changes before the next release. A provider marked planned in the catalog has no working fetch adapter even if its Cargo feature exists.

Start here

Goal Page
Add agentstat to a Rust project Installation
Fetch your first usage snapshot Quick Start
Choose credentials and account scope Credentials and Accounts
Use OpenCode Go or Zen OpenCode Go and Zen
Understand quotas, balances, and errors Reading Results
Find the main Rust types API Reference
See supported and planned providers Provider Coverage
Fix a failed fetch or report a problem Troubleshooting
Report a bug or request a provider Issues and Support
Contribute an adapter or live account check Contributing and Development
See the project backlog and boundaries Roadmap
Find version and release information Releases and Compatibility

What the library does

  • Fetches only when your code calls Client::fetch or Client::fetch_many.
  • Returns typed windows, balances, spend, and warnings in a UsageSnapshot.
  • Keeps missing values missing and monetary amounts as exact decimals.
  • Accepts caller-supplied credentials; local credential files and CLI probes require explicit opt-in.
  • Uses read-only usage and reporting operations. It does not log in, refresh credentials, generate completions to test access, or poll in the background.

The README and Rust API docs are useful alongside this wiki. Implementation details and the latest provider coverage live in the source repository.

Clone this wiki locally