Skip to contents

Tallies hal() turns by model and, when tier info is available, computes cumulative Copilot billing units. Usage is tracked per session in memory and cleared by hal_reset().

Usage

hal_usage(tiers = NULL)

Arguments

tiers

Optional named character vector mapping modelId to usage tier (e.g. c("claude-sonnet-5" = "1x")). When NULL (default), uses the cached tier map populated from the last hal_models() call in this session, or fetches it if none is cached and a live CLI is available. Pass a pre-computed map to skip the network hop.

Value

A hal_usage data frame with columns model, turns, tier, units (numeric tier × turns, NA if tier unknown). Prints a compact summary including the session total.

Examples

if (FALSE) { # \dontrun{
hal("hello")
hal("follow-up", model = "gpt-4.1")
hal_usage()
} # }