Get plan and usage stats
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.
API key authentication - use your Zernio API key as a Bearer token
In: header
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.getUsageStats();console.log(data);{
"billingSystem": "stripe",
"planName": "Pro",
"billingPeriod": "monthly",
"signupDate": "2024-01-15T10:30:00Z",
"billingAnchorDay": 15,
"limits": {
"uploads": 500,
"profiles": 10
},
"usage": {
"uploads": 127,
"profiles": 3,
"lastReset": "2024-11-01T00:00:00Z"
},
"hasAccess": true,
"isInvitedUser": false,
"autoUpgradeEnabled": false
}{
"error": "Unauthorized"
}{
"error": "Not found"
}Create invite token POST
Generate a secure invite link to grant team members access to your profiles. Invites expire after 7 days and are single-use.
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.