Skip to content
by Unity Nodes
Partner docsapi reference › admin › get per model consumption timeseries admin only

NEAR AI Cloud: Get per-model consumption timeseries (Admin only)

Updated 13-11-2026

GET /v1/admin/platform/model-consumption-timeseries Get per-model consumption timeseries (Admin only) Deprecated: this endpoint is moving to cloud-platform at the same path; the cloud-platform base URL will be announced. Behaviour may differ in edge cases.

Returns consumed cost, requests, and tokens per time bucket broken down by model. Top N models by total period cost are returned as separate series; all others are collapsed into a single "Other" bucket. Model labels use the current canonical name from the models table (joined on model_id, rename-safe).

The query does not zero-fill missing (bucket, model) pairs — the frontend must impute zeros for models absent from a bucket.

Consumed cost = metered inference cost, NOT cash revenue (includes grant credits).

Admin permissions: admin session, read_write token, or read_only token. Approved read across organizations; does not mutate business state.

Parameters:

  • start (query, string): Start of time range (ISO 8601). Defaults to 30 days ago.
  • end (query, string): End of time range (ISO 8601). Defaults to now.
  • granularity (query, string): Time granularity: hour (≤31d), day (≤366d, default), week (≤3y), month (≤5y).
  • top_n (query, integer): Top-N models to return as separate series (1-20, default 15); rest → 'Other'.

Responses: 200: Model consumption timeseries retrieved successfully

  • data (array of object, required)
    • bucket (string, required): ISO 8601 bucket start (truncated to granularity).
    • consumed_cost_usd (number, double, required): Consumed usage cost for this (bucket, model) pair, USD.
    • model_label (string, required): Current canonical model name (from models.model_name), or "Other".
    • requests (integer, int64, required)
    • tokens (integer, int64, required): input_tokens + output_tokens.
  • granularity (string, required)
  • model_labels (array of string, required): Ordered list of model labels in the response (top-N + "Other" if present).
  • period_end (string, date-time, required)
  • period_start (string, date-time, required) 400: Invalid request 401: Unauthorized 403: Missing admin privileges (forbidden) or insufficient token permission (insufficient_permissions). 500: Internal server error 504: Analytics statement budget exceeded