LlmCall.Usage (llm_call v0.1.0)

Copy Markdown View Source

Token accounting as reported by the provider.

total_tokens is the provider's total. A provider that reports input split across counters — Anthropic's input_tokens excludes the cached part — is summed by the codec, so the field stays the real total.

Pricing and cost are outside the core: they depend on provider, model, region, cache, and tier, none of which is a wire field.

Summary

Types

t()

@type t() :: %LlmCall.Usage{
  cache_read_tokens: tokens(),
  cache_write_tokens: tokens(),
  input_tokens: tokens(),
  output_tokens: tokens(),
  reasoning_tokens: tokens(),
  total_tokens: tokens()
}

tokens()

@type tokens() :: non_neg_integer() | nil