hal_usage: Session usage summary

View source: R/usage.R

hal_usageR Documentation

Session usage summary

Description

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

## Not run: 
hal("hello")
hal("follow-up", model = "gpt-4.1")
hal_usage()

## End(Not run)


hal documentation built on Oct. 6, 2026, 5:07 p.m.