Feature · Cost tracking

See exactly what every run costs.

Tokens and dollars attributed to the step that emitted them. Roll up by agent, build, deployment, model vendor. Catch cost drift before the invoice arrives.

How it works.

Every LLM span carries token counts and the model used. Trefur multiplies tokens by current pricing per model, per vendor, to produce a dollar figure on each span. Sum the spans in a trace, you get cost per run. Sum the runs in a window, you get cost per agent, per build, per deployment.

Pricing tables are kept current for OpenAI, Anthropic, Bedrock, Azure OpenAI, Gemini, Groq, and MiniMax. Custom model pricing for self-hosted or negotiated rates is available on request.

Cost is graphed live. Filter by agent, build SHA, environment, or any tag you emit. Set an envelope per agent — Trefur alerts when cost-per-run drifts above it, with the worst-offending traces already linked.

What you can do with it.

Cost per trace, per step, per agent, per build, per deployment, per model vendor.
Token counts split into prompt and completion, with USD attributed by current model pricing.
Catch which step pushed the token count — the LLM thinking out loud or the tool blowing up context.
Compare cost-per-run before and after a prompt change, model swap, or context refactor.
Alert on cost-per-run drift outside the normal envelope per agent.
Export per-week, per-team breakdowns for finance without a manual roll-up.

What the cost view looks like.

cost · refund-bot · last 7d · $48.21
$ agent runs avg $/run p95 $/run weekly $
$ refund-bot 14,210 $0.0034 $0.018 $48.21
$ step classify_intent $0.0004
$ step decide_refund_action $0.0022 ← driver
$ step draft_response $0.0008
$
$ alert cost_per_run drift +47% vs baseline (gpt-4o → 4o-mini regressed)

Works with.

OpenAI
Anthropic
Bedrock
Azure OpenAI
Gemini
Groq
MiniMax
Custom

Catch the next cost spike before finance does.

Free tier. No card required. First trace in under five minutes.