Usage snapshot (default) or billed-spend metering (with params)
Dual-mode endpoint, selected by query params — fully backward compatible:
Without metering params (the default): the plan / quota / usage
snapshot — plan name, billing period, limits, usage counts, access
state. Identical to GET /v1/usage-stats. Existing integrations keep
working unchanged.
With range, granularity, from, or to: usage METERING —
billed spend (USD) by product family (accounts, numbers, calls,
sms, dlc, xApi, credits, other) over the window, at
day / month / total granularity, from Metronome's invoice
breakdown (the CHARGE view — always reconciles with what gets billed).
Also served at GET /v1/usage/daily. Usage-based accounts only —
legacy Stripe accounts get { "supported": false, "days": [] }.
For per-domain consumption volumes use GET /v1/usage/calls and
GET /v1/usage/sms. For the billing statement (balance, credits,
caps, payment status) use GET /v1/billing.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
Snapshot mode only. For Stripe subscription users, true forces a
subscription reconciliation pass even when cached plan data looks
complete.
Window to report. cycle / prev-cycle resolve to the customer's
real billing-period bounds (falling back to a trailing 30 days when
no invoice exists yet); 7d…12mo are trailing windows; custom
uses from / to.
"cycle""cycle" | "prev-cycle" | "7d" | "14d" | "30d" | "3mo" | "12mo" | "custom"Inclusive start (UTC date). Required when range=custom.
dateInclusive end (UTC date). Required when range=custom. Max span 366 days.
dateBucketing of the days series: day (one row per UTC day),
month (one row per calendar month, dated to the 1st), or total
(no series — read totals). Does not affect totals.
"day""day" | "month" | "total"Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.usage.getUsage();console.log(data);{
"billingSystem": "stripe",
"planName": "string",
"billingPeriod": "monthly",
"signupDate": "2019-08-24T14:15:22Z",
"billingAnchorDay": 0,
"hasAccess": true,
"customerId": "string",
"isInvitedUser": true,
"autoUpgradeEnabled": true,
"limits": {
"uploads": 0,
"profiles": 0
},
"usage": {
"uploads": 0,
"profiles": 0,
"lastReset": "2019-08-24T14:15:22Z",
"connectedAccounts": 0,
"xApiCalls": {
"x_api_005": 0,
"x_api_010": 0,
"x_api_015": 0
},
"xApiCallsByOperation": {
"posts_read": 42,
"content_create": 7,
"content_create_with_url": 3,
"dm_interaction_create": 1
}
},
"spend": {
"currentPeriodCents": 0,
"creditsRemainingCents": 0,
"xSpendCents": 0,
"xSpendLimitCents": 0
}
}{
"error": "Unauthorized"
}{
"error": "Not found"
}SMS usage (volumes) GET
Aggregated SMS/MMS volumes across your numbers: sent, received, and total message counts, with an optional breakdown by UTC day or by number. Defaults to the last 30 days. Volumes only, deliberately: SMS cost is carrier-rated asynchronously and billed to your invoice, so per-message cost is not available here. Calling usage (GET /v1/usage/calls) does include billable cost.
Get X/Twitter API pricing table GET
Returns Zernio's canonical X/Twitter API pricing table. Each X action has its own Metronome product and its own rate, and Zernio passes X API costs through at exact rates with zero markup. The response is identical for every authenticated user (pricing is universal), so it is safe to cache on the client for the duration of a billing period. To compute your own per-operation spend, pair this endpoint with `GET /v1/usage-stats` — that endpoint returns `usage.xApiCallsByOperation` keyed by the same `operation` field you get here.