Skip to content
Français

Usage

import type { Usage } from "@elie-laloum/outpost";
  • completeOptional
    boolean | undefined
    False when some usage could not be measured, so the counters are a lower bound; aggregation and checkpoint replay keep it. Omitted means the counters are complete as reported, not a billing guarantee.
  • inputRequired
    number
    Input tokens as the agent or model provider reports them. The built-in model providers and Codex count cached tokens inside input; Claude Code and Kimi Code report them only in cached and cacheCreated.
  • cachedRequired
    number
    Reported input tokens served from the model’s cache.
  • cacheCreatedOptional
    number | undefined
    Reported tokens written into the model’s cache, when the protocol supplies them.
  • outputRequired
    number
    Reported output tokens generated by the model.
export interface Usage {
  readonly complete?: boolean;
  readonly input: number;
  readonly cached: number;
  readonly cacheCreated?: number;
  readonly output: number;
}