Get plan and usage snapshot
The usage hub: current plan name, billing period, plan limits, and
usage counts, in one snapshot. For metered consumption over an
arbitrary window with breakdowns (by day, by number), use the
domain spokes: GET /v1/usage/calls and GET /v1/usage/sms.
The response shape depends on the account's billingSystem:
- Stripe users: per-period
usage.uploads/usage.profilescounters. - Metronome (usage-based) users:
usage.connectedAccounts,usage.xApiCallsByOperation(per-operation X API call counts — resolve keys viaGET /v1/billing/x-pricing), plus aspendblock withcurrentPeriodCents,xSpendCents, andxSpendLimitCents. The legacyusage.xApiCalls3-tier aggregate is still emitted for back-compat but excludes the $0.200 URL tier and any future tiers — new clients should consumexApiCallsByOperationonly.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
For Stripe subscription users, true forces a subscription
reconciliation pass even when cached plan data looks complete.
Omit the parameter, or pass false, to use the default
first-time-only reconciliation behavior. Invalid boolean values are
rejected.
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"
}Get plan and usage stats GET
Deprecated alias of `GET /v1/usage`; same contract. New integrations should use that path (the usage hub), with `GET /v1/usage/calls` and `GET /v1/usage/sms` for metered breakdowns. Returns the current plan name, billing period, plan limits, and usage counts. The response shape depends on the account's `billingSystem`: * Stripe users: per-period `usage.uploads` / `usage.profiles` counters. * Metronome (usage-based) users: `usage.connectedAccounts`, `usage.xApiCallsByOperation` (per-operation X API call counts — resolve keys via `GET /v1/billing/x-pricing`), plus a `spend` block with `currentPeriodCents`, `xSpendCents`, and `xSpendLimitCents`. The legacy `usage.xApiCalls` 3-tier aggregate is still emitted for back-compat but excludes the $0.200 URL tier and any future tiers — new clients should consume `xApiCallsByOperation` only.
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.