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.
| Value | Number | Description |
|---|---|---|
CALL_KIND_UNSPECIFIED | 0 | |
CALL_KIND_INFERENCE | 1 |
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.
| Value | Number | Description |
|---|---|---|
TOKEN_USAGE_GROUP_BY_UNSPECIFIED | 0 | |
TOKEN_USAGE_GROUP_BY_NONE | 1 | |
TOKEN_USAGE_GROUP_BY_TENANT | 2 | |
TOKEN_USAGE_GROUP_BY_MODEL | 3 | |
TOKEN_USAGE_GROUP_BY_USER | 4 | |
TOKEN_USAGE_GROUP_BY_API_KEY | 5 |
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.
| Value | Number | Description |
|---|---|---|
CALL_GROUP_BY_UNSPECIFIED | 0 | |
CALL_GROUP_BY_NONE | 1 | |
CALL_GROUP_BY_TENANT | 2 | |
CALL_GROUP_BY_RESOURCE | 3 | |
CALL_GROUP_BY_USER | 4 | |
CALL_GROUP_BY_API_KEY | 5 |
Messages
TimeWindow
TimeWindow is a half-open range, [start, end).
| Field | Type | Number | Description |
|---|---|---|---|
start | google.protobuf.Timestamp | 1 | |
end | google.protobuf.Timestamp | 2 |
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.
| Field | Type | Number | Description |
|---|---|---|---|
inputTokens | uint64 | 1 | |
outputTokens | uint64 | 2 | |
embeddingTokens | uint64 | 3 | |
rerankTokens | uint64 | 4 |
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.
| Field | Type | Number | Description |
|---|---|---|---|
window | TimeWindow | 1 | |
tokens | TokenTotals | 2 |
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.
| Field | Type | Number | Description |
|---|---|---|---|
groupKey | string | 1 | |
points | repeated TokenUsagePoint | 2 |
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.
| Field | Type | Number | Description |
|---|---|---|---|
window | TimeWindow | 1 | |
calls | uint64 | 2 |
CallCountSeries
CallCountSeries is one group's points. group_key works as on TokenUsageSeries, following the CallGroupBy that was requested.
| Field | Type | Number | Description |
|---|---|---|---|
groupKey | string | 1 | |
points | repeated CallCountPoint | 2 |
TokenUsageGroup
TokenUsageGroup is one member of a breakdown, totalled over the response's window. group_key works as on TokenUsageSeries.
| Field | Type | Number | Description |
|---|---|---|---|
groupKey | string | 1 | |
tokens | TokenTotals | 2 |
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.
| Field | Type | Number | Description |
|---|---|---|---|
window | TimeWindow | 1 | |
total | uint64 | 2 | |
clientErrors | uint64 | 3 | |
serverErrors | uint64 | 4 | |
p50Ms | double | 5 | |
p90Ms | double | 6 | |
p99Ms | double | 7 |
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.
| Field | Type | Number | Description |
|---|---|---|---|
groupKey | string | 1 | |
points | repeated ApiTrafficPoint | 2 |