Money
Usage and credits
Limit what each plan can use. Under the limit is free, over the limit one credit covers one unit, and with no credits left the request is denied. Counting happens in a transaction with row locks.
What you get
- Default monthly limits per metric, overridable per plan
- A credit ledger kept in step with each user's balance
- A 402 USAGE_LIMIT response that the chat shows as a message
- Metered invitations through the organization plugin
- Usage bars in settings and audited admin grants
Turn it on
- usageConfig in config.ts
Where it lives
lib/usage.ts