Tracking Usage
To monitor customer usage and enforce limits or billing, record each usage event with Metrifox. Send Usage Events Use theRecordUsage method to log consumable feature usage, such as AI image generations or API calls. You always record usage in feature units (e.g. number of API calls) — never in credits.
Credits are never recorded or deducted directly. A feature is credit-based when it is priced as prepaid with a credit cost (e.g. 1 API call = 0.02 credits). When you record usage for that feature, Metrifox adds to the consumed count and automatically deducts the equivalent credits from the wallet funding it (4 API calls →
0.08 credits deducted).- Call the
RecordUsage - Include relevant metadata (e.g. feature Key, quantity, timestamp)
- Metrifox updates the customer’s usage balance accordingly
SDK available in
Javascript | Ruby | cURL | Python | PHP | Go | Java
Adjusting Usage Counts for Persistent Features
For persistent-use features — features that represent a standing count rather than one-off consumption, such as seats or licenses — you can decrement the recorded usage count by sending a negative value withRecordUsage.
This only applies to persistent features. It does not apply to consumable/event-style usage, and it does not add credits to a customer.
Use Case: Reclaiming Seats
If a customer is using 8 seats and removes one, send a quantity of -1. Metrifox updates their usage count from used: 8 to used: 7, which frees up their available allowance for that feature (available = allowance − used).
This adjusts the usage count of a persistent feature only. To add credits to a customer, use a credit topup — recording negative usage does not add credits.

