Usage
SDK methods for retrieving usage metrics and billing summaries.
The client.usage namespace provides a method for retrieving usage metrics for a billing period. Available in TypeScript, Python, and Go SDKs.
| SDK | Install | Namespace |
|---|---|---|
| TypeScript | npm install @caldera/platformxe-sdk | client.usage |
| Python | pip install platformxe | client.usage |
| Go | go get github.com/calderax/platformxe-go | client.Usage |
Get usage summary
Retrieve aggregated usage metrics for a specific billing month. The month parameter uses YYYY-MM format.
const summary = await client.usage.summary({ month: '2026-04' });
console.log(summary.emailsSent);
console.log(summary.smsSent);
console.log(summary.storageUsedMb);
console.log(summary.apiCalls);
console.log(summary.permissionChecks);
console.log(summary.webhookDeliveries);
summary = client.usage.summary(month="2026-04")
print(summary["emailsSent"])
print(summary["apiCalls"])
summary, err := client.Usage.Summary("2026-04")
Response fields
| Field | Type | Description |
|---|---|---|
month | string | Billing month in YYYY-MM format |
emailsSent | number | Total emails dispatched |
smsSent | number | Total SMS messages sent |
whatsappSent | number | Total WhatsApp messages sent |
storageUsedMb | number | Storage consumed in megabytes |
storageFileCount | number | Total files stored |
apiCalls | number | Total API requests |
permissionChecks | number | Total permission check operations |
webhookDeliveries | number | Total webhook delivery attempts |
pdfGenerated | number | Total PDFs rendered |
ocrVerifications | number | Total OCR verification requests |
qrCodesGenerated | number | Total QR codes generated |
Usage data is updated hourly. The current month's data reflects usage up to the last aggregation cycle. Historical months show final totals.
Scopes required
| Method | Scope |
|---|---|
usage.summary() | exports:create |