NylorunDocsBeta
Management APIModelsUsage and budgets

Export committed model calls in safe transaction order

GET
/v1/tenant/calls/model

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

after?string
limit?integer

A page holds at most the Tenant's Runtime limit exportPageItems (default 1000); a larger limit gets that many. Default 200, or that limit when it is lower

Range1 <= value

Header Parameters

Nylorun-Protocol*string

The protocol version, 18

Response Body

An unfiltered resumable ledger page

application/json
  1. response
calls*array<>
next*string|null
caughtUp*boolean
asOf*string
import { createAdmin } from "@nylorun/admin";const admin = createAdmin();for await (const page of admin.models.exportCalls({ limit: 500 })) {  console.log(page);}
{  "calls": [    {      "id": "string",      "effectId": "string",      "sessionId": "string",      "turnId": "string",      "manifestName": "string",      "provider": "string",      "model": "string",      "at": "string",      "startedAt": "string",      "endedAt": "string",      "outcome": "completed",      "usage": {        "inputTokens": 0,        "outputTokens": 0,        "totalTokens": 0,        "cachedTokens": 0,        "cacheWriteTokens": 0,        "reasoningTokens": 0,        "costUsd": 0,        "duplicate": true,        "tokensReported": true,        "costKnown": true,        "costSplit": {          "input": 0,          "cacheRead": 0,          "cacheWrite": 0,          "output": 0        }      }    }  ],  "next": "string",  "caughtUp": true,  "asOf": "string"}