Usage Events
Track usage for billing
Usage is aggregated and billed at end of period.
Track
await commet.usage.track({
externalId: 'user_123',
eventType: 'api_call',
})Batch
More efficient for high-volume tracking.
await commet.usage.trackBatch({
events: [
{ externalId: 'user_123', eventType: 'api_call' },
{ externalId: 'user_456', eventType: 'api_call' },
]
})Related
How is this guide?