Wasm Directoryalpha
Record

usage-update

Token usage for a session's context window, letting the client render a "context %" indicator. Context % = used / size.

record usage-update {
  used: u64,
  size: u64,
  cost: option​<usage-cost>,
}

Fields

NameTypeDescription
usedu64Tokens currently occupying the model's context window.
sizeu64Total size of the model's context window, in tokens.
costoption​<usage-cost>Optional cost accrued by the session so far, in the units named by [usage-cost.currency].