Skip to main content

cmind/metering/v1/usage_types.proto

Package: cmind.metering.v1

Enums

CallKind

CallKind is a kind of metered call. Today only inference is metered; tool calls and whatever follows get their own value rather than being folded into this one, because counts of different kinds do not sum: one agent run is a single call that may be metered under several kinds.

ValueNumberDescription
CALL_KIND_UNSPECIFIED0
CALL_KIND_INFERENCE1

TokenUsageGroupBy

TokenUsageGroupBy is the dimension a token breakdown groups by. NONE is a real answer, the total over the window, and is distinct from UNSPECIFIED, which is a caller that forgot to say. MODEL is what was called, and is the whole of that axis because only models produce tokens. TENANT, USER and API_KEY are who caused the call. Not every call has all three, so usage that no user or key can be attributed to falls under an empty group key rather than being dropped. A personal key names its owner, so its usage appears under both USER and API_KEY; a service-account key has no owner and appears only under API_KEY.

ValueNumberDescription
TOKEN_USAGE_GROUP_BY_UNSPECIFIED0
TOKEN_USAGE_GROUP_BY_NONE1
TOKEN_USAGE_GROUP_BY_TENANT2
TOKEN_USAGE_GROUP_BY_MODEL3
TOKEN_USAGE_GROUP_BY_USER4
TOKEN_USAGE_GROUP_BY_API_KEY5

CallGroupBy

CallGroupBy is the dimension a count of calls groups by. RESOURCE is whatever the call was made against, generic because calls are counted across kinds: a model today, an MCP server once those are metered. TENANT, USER and API_KEY work as on TokenUsageGroupBy.

ValueNumberDescription
CALL_GROUP_BY_UNSPECIFIED0
CALL_GROUP_BY_NONE1
CALL_GROUP_BY_TENANT2
CALL_GROUP_BY_RESOURCE3
CALL_GROUP_BY_USER4
CALL_GROUP_BY_API_KEY5

Messages

TimeWindow

TimeWindow is a half-open range, [start, end).

FieldTypeNumberDescription
startgoogle.protobuf.Timestamp1
endgoogle.protobuf.Timestamp2

TokenTotals

TokenTotals is the metered token quantity, summed over whatever slice the containing message describes. It exists once so that a new token type is one edit rather than one per result shape.

FieldTypeNumberDescription
inputTokensuint641
outputTokensuint642
embeddingTokensuint643
rerankTokensuint644

TokenUsagePoint

TokenUsagePoint is one time bucket's token totals. The point carries the bucket it covers rather than leaving the caller to derive it from the requested step. Buckets are aligned to interval boundaries, so this window is not necessarily the one that was requested, and the first and last bucket of a series may be only partially covered by it. Callers that need the covered range intersect this window with the one they asked for. Carrying both bounds also keeps a 1d bucket correct across a DST boundary, where it is not 24 hours.

FieldTypeNumberDescription
windowTimeWindow1
tokensTokenTotals2

TokenUsageSeries

TokenUsageSeries is one group's points, ordered by window. group_key holds the id of whatever TokenUsageGroupBy was requested, or empty when the request did not group or the row could not be attributed.

FieldTypeNumberDescription
groupKeystring1
pointsrepeated TokenUsagePoint2

CallCountPoint

CallCountPoint is one time bucket's count of distinct metered calls. A call counts once however many quantities it was metered for. The window works as on TokenUsagePoint.

FieldTypeNumberDescription
windowTimeWindow1
callsuint642

CallCountSeries

CallCountSeries is one group's points. group_key works as on TokenUsageSeries, following the CallGroupBy that was requested.

FieldTypeNumberDescription
groupKeystring1
pointsrepeated CallCountPoint2

TokenUsageGroup

TokenUsageGroup is one member of a breakdown, totalled over the response's window. group_key works as on TokenUsageSeries.

FieldTypeNumberDescription
groupKeystring1
tokensTokenTotals2

ApiTrafficPoint

ApiTrafficPoint is one time bucket of HTTP traffic: total requests, client and server error counts, and latency percentiles in milliseconds. This counts every request, including ones that never reached a model, so it shares no filter axis with the metered-usage queries. The window works as on TokenUsagePoint.

FieldTypeNumberDescription
windowTimeWindow1
totaluint642
clientErrorsuint643
serverErrorsuint644
p50Msdouble5
p90Msdouble6
p99Msdouble7

ApiTrafficSeries

ApiTrafficSeries is one group's points. No request groups on this today, so group_key is always empty; service is the axis if one is ever wanted.

FieldTypeNumberDescription
groupKeystring1
pointsrepeated ApiTrafficPoint2