API reference
Get traffic
The account's calls over a window, from the request log: about 30 equal buckets of calls, failures and p50/p95 answer times, the totals with the error rate and calls a minute, the ten operations failing most with their most common code, and the last 20 failed calls with their operation, code, time and request id. Aggregates only: never a key, a person or what was sent or answered. Percentiles are approximate (t-digest).
Needs scope usage:read.
bearerAuthorizationBearer <token>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.
window?string5m, 15m, 1h, 6h or 24h; empty is 15m.
until?stringRFC 3339; the window ends here. Empty is now; within the last 30 days.
rpc_prefix?stringOnly operations whose full name starts with this, such as iohr.billing.; empty for all.
iohr.accounts.v1.GetTrafficResponse
application/json- response
iohr.accounts.v1.GetTrafficResponse
bucket_secs*integerint32buckets*array<>from*stringquantiles*stringrecent_failures*array<>to*stringtop_failing*array<>totals?iohr.accounts.v1.TrafficTotals
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.getTraffic("<org_id>"); console.log(value);} catch (e) { if (!(e instanceof ApiError)) throw e; console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`);}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.
{ "bucket_secs": 0, "buckets": [ { "at": "string", "calls": "string", "client_failures": "string", "failures": "string", "p50_ms": 0, "p95_ms": 0, "platform_failures": "string" } ], "from": "string", "quantiles": "string", "recent_failures": [ { "at": "string", "code": "string", "duration_ms": 0, "outcome": "string", "request_id": "string", "rpc": "string" } ], "to": "string", "top_failing": [ { "calls": "string", "error_rate": 0.1, "failures": "string", "p95_ms": 0, "rpc": "string", "top_code": "string" } ], "totals": { "calls": "string", "calls_per_minute": 0.1, "client_failures": "string", "error_rate": 0.1, "failures": "string", "p50_ms": 0, "p95_ms": 0, "p99_ms": 0, "platform_error_rate": 0.1, "platform_failures": "string" }}List requests GET
Every call counted for the account in the last 30 days, newest first: when, which key or person, which operation, how it ended (ok, a client error or a platform error, with its code), how long it took, and its request id. Never what was sent or answered. Filter by status (ok, error, client, platform), a request id or key id, or part of an operation's name. Needs scope `usage:read`.
Get usage by day GET
What the account used, by day, service and metric: the last 30 days unless `from` and `to` say otherwise, at most 366 days. A key reads its own account. Needs scope `usage:read`.