cost-meter
Aggregate LLM API cost across providers, models, and time windows.
Provider-agnostic — pairs with
claude-cost,
openai-cost,
gemini-cost, and
bedrock-cost.
Why
Every team that runs LLMs in production rebuilds the same dashboard: a counter of calls and dollars, broken down by provider and model. This is the small, dependency-free piece that does the counting.
Usage
use ;
let mut meter = new;
meter.record;
meter.record;
let s = meter.snapshot;
println!;
for in meter.by_provider
Pair it with one of the pricing crates:
use ;
use ;
let model = "claude-sonnet-4-5";
let pricing = default_pricing.unwrap;
let usage = Usage ;
let cost = pricing.cost_for;
let mut m = new;
m.record;
Features
serde— deriveSerialize/DeserializeonBucketandSnapshot.
License
MIT or Apache-2.0.