Skip to main content
Version: v5.7.0

Model usage and provider usage

packs:ai-agents

The usage telemetry's read shapes, served by the v2 ModelUsageService. The model lane — one row per token bucket and group, the totals over a window, the cap recommendations from the observed distribution — through SummarizeModelUsage, ExportModelUsage (CSV) and RecommendCaps, which need read on the project path (404-on-deny), read on the root for the estate. The provider lane every family shares — one row per bucket, provider and metric, and the overview of every registered provider — through ListProviderUsage and ListProvidersOverview, which sit behind the provider-record administrator's verdict. Facts only — no price, cost or currency (opschain docs provider-usage).

ModelUsageRow​

One bucket of one group: a minute row straight off the UTC table, or a rolled-up bucket on the calendar it was rolled under.

FieldTypeMeaning
agent_codestringThe agent's code (filled when grouped by agent; always on an export).
bucket_endtimestampThe first instant after the bucket.
bucket_labelstringThe bucket start rendered in the response's timezone (RFC 3339 with its offset) — the label a table or chart shows.
bucket_starttimestampThe bucket's start instant (UTC on the wire).
cache_creation_tokensinteger/stringPrompt-cache creation tokens the provider reported; recorded, never metered against a cap.
cache_read_tokensinteger/stringPrompt-cache read tokens the provider reported; recorded, never metered.
calendar_supersededbooleanTrue on an exported row rolled under a previous calendar; a summary never includes one.
callsinteger/stringServed calls in the bucket.
fiscal_year_startstringThe MM-DD fiscal year start the row was rolled under (empty on minute rows).
grainstringminute, hour, day, week, month, quarter or year.
grant_idstringThe most specific token-capped grant the calls were attributed to; empty when no cap applied.
input_tokensinteger/stringInput (prompt) tokens.
max_call_tokensinteger/stringThe largest single call in the bucket (input + output).
modelstringThe model the provider's response reported (the request's model when the response named none).
output_tokensinteger/stringOutput (completion) tokens.
peak_day_tokensinteger/stringThe busiest day's total inside a week row or coarser.
peak_hour_tokensinteger/stringThe busiest hour's total inside a day row or coarser.
peak_minute_tokensinteger/stringThe busiest minute's total inside an hour row or coarser (a minute row's own total).
project_pathstringThe project the agent is enrolled in (/code).
provider_codestringThe model provider record's code.
provider_kindstringThe model provider record's kind (anthropic, openai, azure-openai, openai-compatible), resolved from the registry by the row's code; empty when the row is not grouped by provider.
refused_callsinteger/stringCalls refused pre-flight by a token-cap window; they spent nothing.
timezonestringThe IANA zone the row was rolled under (empty on minute rows).
total_tokensinteger/stringinput_tokens + output_tokens — the figure the caps meter.

ModelUsageTotals​

The sums over a summary's rows.

FieldTypeMeaning
approaching_countinteger/stringHow many (grant, window, period) cap-approaching warnings fired for the grants the rows carry, over periods still within the counter retention.
cache_creation_tokensinteger/stringSum of the rows' cache-creation tokens.
cache_read_tokensinteger/stringSum of the rows' cache-read tokens.
callsinteger/stringSum of served calls.
input_tokensinteger/stringSum of input tokens.
output_tokensinteger/stringSum of output tokens.
refused_callsinteger/stringSum of refused calls.
total_tokensinteger/stringSum of total_tokens.

The summary response also carries since, until, grain, group_by, timezone (the zone the labels were rendered in) and the project's reporting calendar as calendar_timezone / calendar_fiscal_year_start. The export response is csv (one header row, then one row per bucket and tuple with the same columns as ModelUsageRow) and row_count.

CapRecommendation​

One window's proposed cap and the figures behind it (RecommendCaps), answered beside the measured TrustGrant and the since the history was read from.

FieldTypeMeaning
current_capinteger/stringThe grant's cap on this window today; zero when unset.
headroomnumberThe multiplier applied to the p95 (1.5 by default).
observed_p95integer/stringThe p95 of the window's per-bucket totals (nearest rank).
observed_peakinteger/stringThe busiest bucket's total.
observed_totalinteger/stringThe sum over the observed buckets.
recommended_capinteger/stringp95 × headroom, rounded up — never below the peak while fewer than twenty buckets were seen.
samplesintegerHow many buckets were observed.
windowstringminute, day, week, month, quarter or year.

ProviderUsageRow​

One bucket of one provider's one metric (ListProviderUsage): a minute row straight off the UTC table, or a rolled-up bucket on the calendar it was rolled under. The request names the family (kind: secrets, transport, model, image_build, image_registry, identity, siem, otlp, github or jsm), optionally one code, the grain, the window (from, to), optionally one metric, one extra group_by dimension (project, detail, agent, grant), a project_code and the label timezone.

FieldTypeMeaning
agent_codestringThe agent's code (filled when grouped by agent; the model lane only).
bucket_endtimestampThe first instant after the bucket.
bucket_labelstringThe bucket start rendered in the response's timezone (RFC 3339 with its offset).
bucket_starttimestampThe bucket's start instant (UTC on the wire).
countinteger/stringSamples in the bucket — a counter's count.
detailstringWhat the family records as its detail (the model a call reported, the image a push carried); filled when grouped by detail.
errorsinteger/stringThe samples that failed (a failure metric's count lands here too).
fiscal_year_startstringThe MM-DD fiscal year start the row was rolled under (empty on minute rows).
grainstringminute, hour, day, week, month, quarter or year.
grant_idstringThe token-capped grant the calls were attributed to (filled when grouped by grant; the model lane only).
latency_max_msinteger/stringThe slowest single sample, where the seam times the call.
latency_sum_msinteger/stringThe summed latency, where the seam times the call.
metricstringThe metric the row counts (opschain docs provider-usage, "The families and their metrics").
peak_day_valueinteger/stringThe busiest day's value inside a week row or coarser.
peak_hour_valueinteger/stringThe busiest hour's value inside a day row or coarser.
peak_minute_valueinteger/stringThe busiest minute's value inside an hour row or coarser (a minute row's own value).
project_pathstringThe project the call was made for (filled when grouped by project or agent); empty on platform-level rows.
provider_codestringThe provider record's code.
provider_kindstringThe family.
value_maxinteger/stringThe largest single sample (a value metric's quantity; a gauge's highest reading).
value_suminteger/stringThe summed value — a counter's count, a value metric's quantity (tokens, bytes, seconds).

ProviderUsageMetricTotal​

One per metric the family registers (zero when nothing was recorded), summing the response's rows.

FieldTypeMeaning
countinteger/stringSum of count.
errorsinteger/stringSum of errors.
latency_max_msinteger/stringThe slowest sample over the window.
latency_sum_msinteger/stringSum of latency_sum_ms.
metricstringThe metric.
metric_kindstringcount, value or gauge — how the metric's value reads.
value_maxinteger/stringThe largest sample over the window.
value_suminteger/stringSum of value_sum.

The response also carries from, to, grain, group_by, timezone (the zone the labels were rendered in), the reporting calendar as calendar_timezone / calendar_fiscal_year_start and, when the request names one model provider whose record carries a provider-level model budget, token_budget — one ProviderTokenBudgetWindow per window with a ceiling.

ProviderTokenBudgetWindow​

One window of a model provider's provider-level model budget at the instant of the read (opschain docs model-providers): the ceiling the record sets, the shared counter's spend across every agent and every call through the provider, what remains, and the window's local boundaries on the estate's reporting calendar. Carried by ListProviderUsage (token_budget) and by a model provider's ProviderOverviewRow.

FieldTypeMeaning
capinteger/stringThe ceiling the provider record sets on this window.
fractionnumberused / cap.
remaininginteger/stringcap - used, never below zero.
resets_attimestampThe first instant after the window — when the counter starts over (the sliding minute: one minute after the read).
usedinteger/stringThe tokens spent in the window so far, across every agent and call through the provider.
windowstringminute, day, week, month, quarter or year.
window_starttimestampThe window's start instant.

ProviderOverviewRow​

One registered provider on the overview (ListProvidersOverview), answered beside today_start (the reporting calendar's local midnight), computed_at and calendar_timezone.

FieldTypeMeaning
codestringThe provider record's code.
display_namestringThe record's display name.
enabledbooleanWhether the record is enabled.
gaugesmapThe family's gauges' current readings keyed by metric (backlog_depth, rate_limit_remaining); absent until first observed.
health_checked_attimestampWhen the health was last established (the test verb's run; a SIEM connection's last delivery).
health_errorstringThe last probe's failure; empty while healthy. Never credential material.
health_statusstringhealthy, unhealthy or unknown (never probed, or the family keeps no probe) — the health probe's last result, never a metric.
kindstringThe family.
metricsstring[]The metrics the family records, so a page can show the full set.
provider_kindstringThe record's own kind within its family (anthropic, openbao, ssh-ca, splunk_hec …); empty where the family has one shape.
today_countinteger/stringThe family's primary metric's count since today_start.
today_errorsinteger/stringThe errors across every metric since today_start.
token_budgetProviderTokenBudgetWindow[]A model provider's provider-level model budget at the instant of the read — one entry per window the record sets a ceiling on; empty for every other family and for a provider with no ceiling.

From the CLI​

opschain agents usage (opschain docs cli/agents-usage) renders the model summary as a table, -o json as this document, -o csv as the export; --recommend-caps --grant <id> prints the recommendations and --propose raises the replacement grant through the approval funnel. opschain admin providers usage and opschain admin providers overview (opschain docs cli/admin-providers) render the provider rows and the overview.

  • opschain docs provider-usage — the component page: the families, the buckets, the calendar, the six windows.
  • opschain docs resources/trust — the grant's tokens_per_* fields.
  • opschain docs settings-reference — the usage.* settings.