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
Range1 <= value <= 1000
Default200

Header Parameters

Nylorun-Protocol*string

The protocol version, 8

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",      "sessionId": "string",      "turnId": "string",      "agentId": "string",      "provider": "string",      "model": "string",      "at": "string",      "outcome": "completed",      "usage": {        "inputTokens": 0,        "outputTokens": 0,        "totalTokens": 0,        "cachedTokens": 0,        "cacheWriteTokens": 0,        "reasoningTokens": 0,        "costUsd": 0,        "duplicate": true,        "tokensReported": true,        "costKnown": true      }    }  ],  "next": "string",  "caughtUp": true,  "asOf": "string"}