Usage, logs & transactions
See credits remaining, recent spend, request logs, and your credit ledger from the terminal with the AnyRouter CLI.
Three read-only commands surface your account activity without leaving the terminal. They authenticate with the same key your launches use — no extra setup after login.
Credits & spend
anyr usageCredits remaining $18.42
monthly $16.00 · top-up $2.42
Spend (24h) $1.37
Lifetime used $103.11
Top models
anthropic/claude-sonnet-4-6 $0.98 · 41 req
z-ai/glm-4.7 $0.39 · 87 reqThe 24h spend and top-models lines are aggregated from your recent request logs. On a very busy day the CLI bounds how far it crawls and shows the number as a floor (≥ $…). If the network is down, the last cached snapshot prints instead, clearly marked (cached · 2h ago). Pass --no-detail to skip the log aggregation and make exactly one API call.
Request logs
anyr logs # latest 20 requests, newest first
anyr logs --limit 50 # 1 to 100 per call
anyr logs --status error # ok | error (the error code shows inline)
anyr logs --model z-ai/glm-4.7
anyr logs <id> # one request in detail
anyr logs sessions # requests grouped by sessionColumns: time (your local zone), model, provider, status, tokens in and out, cost, and latency. History depth follows your plan's log-retention window.
Credit ledger
anyr transactions # newest first, 20 rows
anyr transactions --type purchase
anyr transactions --limit 100Every credit movement, such as top-ups, per-request spend and refunds, with the signed amount, your balance after it (when the entry has one) and a note.
Scripting
All three commands accept --json for machine-readable output, print plain text with no colors when piped, and exit non-zero with a one-line reason on failure:
anyr usage --json | jq .balance
anyr logs --json --status error | jq '.data | length'
anyr transactions --json | jq '.data[0]'Errors print error: <message> on stderr; with --json they print as one JSON object instead. The exit code tells you what went wrong: 1 error, 2 usage, 3 not found, 4 no key or a key without the needed permission (the message names the missing scope), 5 rate limited. See Use anyr from scripts and AI agents.
A key can also be passed explicitly with --key or the ANYROUTER_API_KEY environment variable — useful in CI.
AnyRouter routes requests to third-party models. Models and outputs are provided as is, with no warranty; you use them at your own risk. Disclaimer