Skip to content

Usage, cost & context

The engine emits a context meter with every model step, so the TUI footer moves while a turn runs, not only between turns:

  • context percentage (the ctx NN% gauge)
  • session cost in USD
  • cache-hit percentage
  • reasoning effort, whenever the model exposes reasoning control

ka refuses to display numbers it cannot stand behind:

  • Curated placeholder prices are flagged priced = false; the footer and ka models never show costs computed from unverified rows.
  • The models.dev overlay (cargo xtask models-sync in the repository) carries real published pricing.
  • Subscription plans (coding-plan models) appear as unpriced plan rows; you pay the subscription, not per token.
  • With an unpriced model active, guarded-mode approval prompts omit the cost estimate instead of inventing one.

Two thresholds, both off by default, ask once per session when crossed:

[guards]
spend_usd = 2.0 # session total cost
context_pct = 90 # context meter percentage

Answering stop aborts the current turn cleanly; the strand stays intact.

The context survival ladder kicks in, cheapest first:

  1. Caps + spill: oversized tool output becomes a spill:// pointer on disk before the model sees it.
  2. Prune: blank tool results outside the protected window are elided.
  3. Digest: a same-model summary (/compact [focus] triggers one manually) that never separates a tool call from its result.
  4. Promotion: with [context] promote = true (the default), an overflowing turn can be re-dispatched to a bigger-context sibling of the same family.

/context in the TUI shows where the window stands.