Skip to content
Français

Usage

import type { Usage } from "@elie-laloum/outpost/core";
  • modelsOptional
    Readonly<Record<string, ModelUsage>> | undefined
    Model-attributed counters, each with its cache convention. Priced dispatches fill this from explicit CLI models, harness requests and built-in subagents, keyed by model name. Without prices, CLI agent turns are still attributed under <agent>:<model>, or the agent name when no model is configured. Custom or queued tasks must preserve or provide it. Aggregate counters stay available and add entries as reported.
  • 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 models?: Readonly<Record<string, ModelUsage>>;
  readonly complete?: boolean;
  readonly input: number;
  readonly cached: number;
  readonly cacheCreated?: number;
  readonly output: number;
}