Configuration
llm-usage-metrics is configured through CLI flags and environment variables.
Path overrides
Section titled “Path overrides”Directory-backed sources:
llm-usage daily --pi-dir /path/to/pi --codex-dir /path/to/codexGeneric directory override syntax:
llm-usage daily --source-dir pi=/path/to/pi --source-dir codex=/path/to/codexOpenCode uses a dedicated DB override flag:
llm-usage daily --opencode-db /path/to/opencode.dbNotes:
--source-diris directory-only (pi,codex).--source-dir opencode=...is rejected; use--opencode-db.- OpenCode path precedence is:
--opencode-db- deterministic OS-specific default DB candidates
Source selection
Section titled “Source selection”llm-usage monthly --source pillm-usage monthly --source pi,codexllm-usage monthly --source opencode --opencode-db /path/to/opencode.dbRuntime environment variables
Section titled “Runtime environment variables”Update notifier and parsing/pricing runtime knobs (see Caching for behavior details):
LLM_USAGE_SKIP_UPDATE_CHECKLLM_USAGE_UPDATE_CACHE_SCOPELLM_USAGE_UPDATE_CACHE_SESSION_KEYLLM_USAGE_UPDATE_CACHE_TTL_MSLLM_USAGE_UPDATE_FETCH_TIMEOUT_MSLLM_USAGE_PRICING_CACHE_TTL_MSLLM_USAGE_PRICING_FETCH_TIMEOUT_MSLLM_USAGE_PARSE_MAX_PARALLELLLM_USAGE_PARSE_CACHE_ENABLEDLLM_USAGE_PARSE_CACHE_TTL_MSLLM_USAGE_PARSE_CACHE_MAX_ENTRIESLLM_USAGE_PARSE_CACHE_MAX_BYTES
Example:
LLM_USAGE_PARSE_MAX_PARALLEL=16 LLM_USAGE_PRICING_FETCH_TIMEOUT_MS=8000 llm-usage monthly