Balance model
EthanKit treats the wallet as a shared account resource. Products report usage, and the platform settles the cost against the same balance.
Usage records
Each usage event should include the product, model or unit, request identity, and settlement state. This keeps invoices explainable and makes quota bugs easier to inspect.
Recommended checks
- At the runtime gateway's authorize step, reject usage when the available balance cannot cover the request. This is enforced only when a hard limit is configured and the wallet balance or quota state is empty/exhausted. The
/usage/ingestpath does not enforce balance and always accepts. - Make settlement idempotent
- Keep product slugs stable in analytics and exports