Wardrik.Spending (wardrik v0.1.0-rc.1)

Copy Markdown

Counts what each agent spends per UTC day, in tokens and, where priced, dollars.

Every agent Wardrik starts has it as middleware around model and tool calls. Agent lists show it. Subagents' calls count as part of the tool call that ran them.

Summary

Functions

Returns what the agent id spent today.

Functions

today(wardrik, id)

@spec today(Wardrik.t(), String.t()) :: %{required(String.t()) => number()}

Returns what the agent id spent today.

Wardrik.Spending.today(wardrik, "acme/triage")
#=> %{"tokens" => 12_400, "usd" => 0.03}