Usage and units
Get this month's units
Have a token? Manage tokens in the console
GET
The account's units this month: the plan, the allowance, what was used by category, operation and key, and what remains. A key reads its own account.
Needs scope usage:read.
bearerheader
AuthorizationBearer <JWT>An access token from the identity provider: a person's, or a customer's from the client credentials grant with an API key (developers.inorbit.hr). The gateway verifies it; the audience is iohr-api.
org_id*stringThe account's id: org in GET /v1/me.
iohr.accounts.v1.GetUnitsResponse
application/json- response
iohr.accounts.v1.GetUnitsResponse
account_id*stringallowance*stringFormat
int64days*array<>granted*stringFormat
int64month*stringplan?iohr.accounts.v1.Plan
remaining*stringFormat
int64resets_at*stringspending_limit?iohr.accounts.v1.SpendingLimit
usage*array<>used*stringFormat
int64SDK
HTTP
import { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try { const { value } = await api.accounts.getUnits("<org_id>"); console.log(value);} catch (e) { if (!(e instanceof ApiError)) throw e; console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`); process.exitCode = 1;}npm install @inorbithr/sdk. Calls the package's public surface; an operation newer than your package needs the next release or a client generated for your account. The SDKs.
Example Response
{ "account_id": "string", "allowance": "string", "days": [ { "day": "string", "units": "string" } ], "granted": "string", "month": "string", "plan": { "accounts": "string", "at_zero": "string", "description": "string", "monthly_units": "string", "name": "string", "updated_at": "string" }, "remaining": "string", "resets_at": "string", "spending_limit": { "cap_cents": "string", "cap_units": "string", "capped": true, "cents_per_million": "string", "currency": "string", "is_default": true, "overage": true, "overage_units": "string" }, "usage": [ { "calls": "string", "category": "string", "client_errors": "string", "key_id": "string", "key_name": "string", "p50_ms": 0, "p95_ms": 0, "platform_errors": "string", "rpc": "string", "tokens": "string", "units": "string", "user_id": "string", "user_name": "string" } ], "used": "string"}