Check and report limits and usage for the providers defined in Claude Code Router config.
go install github.com/Djarvur/ccr-models-usage@latestThe binary is installed as ccr-models-usage into $GOBIN (or $HOME/go/bin
by default).
ccr-models-usage
# or with a custom config path:
ccr-models-usage -config /path/to/config.jsonBy default the program reads ~/.claude-code-router/config.json, deduplicates
the configured providers by (hostname, api_key), and prints a short
per-provider usage report. Providers the program does not know how to query
are still listed with skip (no adapter).
OpenCode Go does not expose a usage API and its API key only authorizes
inference, so the program authenticates to the dashboard with a
(username, password) pair. Configure it via either of:
-
Environment variables:
export OPENCODE_GO_USERNAME=... export OPENCODE_GO_PASSWORD=...
-
A JSON file at
$XDG_CONFIG_HOME/ccr-models-usage/opencode-go.json(or~/.config/ccr-models-usage/opencode-go.json):{ "username": "...", "password": "..." }
The file should be chmod 600. The program never writes to it and never
logs the values.
make ciruns lint, test, and build.
make lint requires
golangci-lint. Install it via
the official installer:
# Linux/macOS, one-liner
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/binOther make targets: make build, make test, make lint.