NylorunDocsBeta
Management APIModelsUsage and budgets

Get what the Tenant's model calls used

GET
/v1/tenant/usage

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.

Authorization

managementKey
headerAuthorizationBearer <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).

Query Parameters

scope?string
Default"tenant"
Value in"tenant""agent""turn"
id?string
Length1 <= length
period?string
Default"total"
Value in"day""month""total"

Header Parameters

Nylorun-Protocol*string

The protocol version, 8

Response Body

The calls, tokens and cost

application/json
  1. response
scope*string
Value in"tenant""agent""turn"
id?string
period*string
Value in"day""month""total"
since?string
calls*integer
Range0 <= value
tokens*integer
Range0 <= value
costUsd*number
Range0 <= value
import { 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}