Skip to content

CumulativeTokenUsage

Session running totals of counted-once usage.

Amendment: the cache splits and server-computed cost join the counters. The counters stay accumulate-only; cost is the documented exception — it may move either way on price re-adoption and is labeled estimate. Copy was dropped for the cost member.

  • cacheReadTokens
  • cacheWriteTokens
  • cost
  • outputTokens
  • promptTokens
  • totalTokens
Source

schema/msp/experimental/msp.schema.json#/types/CumulativeTokenUsage

{
"description": "Session running totals of counted-once usage.\n\nAmendment: the cache splits and server-computed `cost` join the\ncounters. The counters stay accumulate-only; `cost` is the documented\nexception — it may move either way on price re-adoption and is labeled\nestimate. `Copy` was dropped for the `cost` member.",
"properties": {
"cacheReadTokens": {
"description": "Cache-read tokens, session total: saturating sum of\nthe per-completion splits; an absent split contributes 0.\nAdditive-optional: absent on the wire reads as 0 and zero totals\nare omitted, so pre-feature bytes decode and re-encode identically.",
"type": "integer"
},
"cacheWriteTokens": {
"description": "Cache-write tokens, session total. Additive-optional\nlike the read split.",
"type": "integer"
},
"cost": {
"$ref": "#/$defs/CumulativeCost",
"description": "Server-computed session cost: `None` (wire-absent)\nwhen no leg is priced — clients omit the row. Additive-optional:\nabsent reads as unpriced."
},
"outputTokens": {
"description": "Output tokens, session total.",
"type": "integer"
},
"promptTokens": {
"description": "Counted-once prompt tokens, session total.",
"type": "integer"
},
"totalTokens": {
"description": "Counted-once totals, session total.",
"type": "integer"
}
},
"required": [
"outputTokens",
"promptTokens",
"totalTokens"
],
"type": "object"
}