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/calderaxe/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' });
for (const s of summary.services) {
console.log(s.service, s.used, s.limit, s.percentUsed);
}
console.log(summary.totalBillableEvents);
summary = client.usage.summary(month="2026-04")
for s in summary["services"]:
print(s["service"], s["used"], s["limit"])
print(summary["totalBillableEvents"])
summary, err := client.Usage.Summary("2026-04")
Response fields
| Field | Type | Description |
|---|---|---|
month | string | The month reported, YYYY-MM (UTC) |
organization | string | The key's organisation id |
services | array | One entry per service with usage in the month: service, used, limit (null without a plan limit; for storage, your organisation's storage allowance: its contract limit when set, else the plan's, or null when not capped), percentUsed (null without a limit) |
services[].used | number | A count in the service's unit; for storage, the bytes the organisation stores now in media files and fixed documents (never negative), set against the storage capacity |
totalBillableEvents | number | Usage events in the month across every service (an upload counts once; bytes are never added) |
See Usage Summary for an example response.
Scopes required
| Method | Scope |
|---|---|
usage.summary() | none (any valid key but an MCP key; its own organisation only) |