Documentation
¶
Overview ¶
Package usage computes the USD cost of an LLM token breakdown from a model price table. It is deliberately small and self-contained: the daemon can't see an agent's LLM calls (they're opaque outbound traffic), so token counts arrive from the agent's own usage hook and cost is derived here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tokens ¶
type Tokens struct {
Input int // fresh (uncached) input tokens
CacheCreation int // tokens written to the prompt cache (billed > fresh input)
CacheRead int // tokens served from the prompt cache (billed << fresh input)
Output int // generated output tokens
}
Tokens is an Anthropic-shaped token breakdown for a session (cumulative). The fields mirror the `usage` block in a Claude Code transcript.
Click to show internal directories.
Click to hide internal directories.