ModelsUsage and budgets
Get what the Tenant's model calls used
GET
Totals from the model usage ledger, which the model gate writes once per call: for the Tenant, one agent or one turn, over the current UTC day or month, or all time.
managementKeyheader
AuthorizationBearer <token>A management key of the Tenant (role management): it reaches the Management API (/v1/tenant/*) and /v1/me, as itself, never for a subject. Issued only on the Tenant's machine (nylorun-operate keys put <id> --role management) or from NYLORUN_MANAGEMENT_KEY_FILE. Never accepted from a browser (Origin).
scope?stringDefault
"tenant"Value in
"tenant""agent""turn"id?stringLength
1 <= lengthperiod?stringDefault
"total"Value in
"day""month""total"Nylorun-Protocol*stringThe protocol version, 8
The calls, tokens and cost
application/json- response
scope*stringValue in
"tenant""agent""turn"id?stringperiod*stringValue in
"day""month""total"since?stringcalls*integerRange
0 <= valuetokens*integerRange
0 <= valuecostUsd*numberRange
0 <= valueimport { createAdmin } from "@nylorun/admin";const admin = createAdmin();const usage = await admin.models.usage({ scope: "tenant", period: "month" });{ "scope": "tenant", "id": "string", "period": "day", "since": "string", "calls": 0, "tokens": 0, "costUsd": 0}