Skip to main content

GET /api/usage

A JSON snapshot for the subject making the call — session cookie or API key. The same numbers the account page shows.

curl https://rewr.it/api/usage -H "Authorization: Bearer hn_..."

What comes back

Plan and period counters, plus the credit wallet:

FieldMeans
plananonymous | free | pro
requestsRewrites used this period
resetAtWhen the period rolls over
creditBalanceCredits available to spend
reservedCreditsHeld for requests currently in flight
purchasedCreditsBought, lifetime
spentCreditsSpent, lifetime
canBuyCreditsWhether this subject may buy more

Included quota is spent first

Included allowance goes before wallet credits, always. A rewrite only touches credits once the period's included requests or input tokens are gone. The usage event on a rewrite stream says which one paid, via fundingSource.

API keys spend the owning user's wallet. There is no separate per-key balance.

Polling

Don't. Read the usage event on the rewrite stream — it carries the post-request numbers and costs nothing extra. Call this endpoint when a client starts, or after a purchase.