no effort. huge gain.
Caps stop overruns, waste gets caught, cheaper routing is proven — hundreds to thousands, automatically.
Every call feeds a cost + quality corpus. It gets sharper with each batch — your own playbook, growing.
Not just what you spent — what’s worth spending: $/good-result, what to downgrade, surfaced continuously.
the agentic loop — it runs with your agents, not after them
what it does
A zero-spend projection runs before every batch; the call is hard-capped before a token is spent.
Daily and monthly ceilings per resource class, plus one total backstop. Breach any → blocked or alerted.
Every row matched to OpenAI, Anthropic and vast.ai billing — by a per-row id, fully auditable.
What caching, caps and cascades save — mean, p10–p90 and a conservative floor, not a vanity number.
Per user → team → org, LLM + GPU, one ledger — spend attributed to the work that caused it.
A receipt after every run — tokens, estimate → actual, and a running daily / weekly / monthly tally scoped to the repo — right in Claude Code, Codex, or your terminal.
Spin up a vast.ai box and the gate is enforced from boot — fail-closed, so a remote script cannot spend ungated; its spend still rolls up to the org.
Agents check the budget and the org’s cost learnings before they spend — through the team dashboard’s scope-bound remote MCP, or the client’s CLI on your machine. Governance they can reason with.
Actual tokens recorded as they stream — batch, realtime and the Responses API, sync or async, OpenAI and Anthropic. Live truth, not a guess after the fact.
A coverage audit flags any environment with an LLM SDK but no gate — so a stray venv or script can never spend silently. Reconcile catches the rest against provider bills.
Real billed dollars — API + subscription + remote compute — kept separate from subscription value (Claude Code, claude.ai). Never one misleading total.
Immutable spend events in integer micros, hash-chained — every number traces back to the exact call, lifecycle and version that produced it.
smart attribution
Smart tagging reads your conversations and code to attribute each call to the right project and intent — no manual bookkeeping. Then it rolls up across who and what.
A clean P&L by team, by project, by intent — orthogonal dimensions, no double-counting, zero manual tagging. Across any period: day, week, month, quarter, year or YTD.
learn & optimize — the part that pays for itself
Every call feeds a private cost + quality corpus, and an advisor turns it into proven savings — never a blind downgrade. All caged: estimate-first, on your own key, recorded so you never re-pay.
Real prompts and outputs sampled and judged good-vs-wasteful — your own playbook of what works, sharper every batch.
Runs a cheaper config beside your current one and only recommends the change when the output holds. No guessing, no quality regressions.
Route cheap-model-first → verify → escalate only when the cheap answer fails. Same results for a fraction of the spend.
A semantic response cache and batch dedup catch repeated work before it bills; a cache audit shows exactly what prompt-caching would save.
Learnings auto-applied on every call — max_tokens at your measured p99, reasoning effort, batch packing — tuned to how each model behaves for you.
Backtest a recommendation against your own history before you trust it, and import scrubbed cost lessons from the community (or export yours).
depth, not a dashboard — what it actually catches
cancelled-but-billed jobs that dashboards never show as loss
provider-billed spend an ungated venv or script ran silently
under-batched calls a cheaper model + packing would have done
install in a minute — configure with zero LLM calls
Install the client, then set caps with spendguard init. It's deterministic — no API key, no model call (you don't need an LLM to configure the thing that governs LLMs). Two ways to answer:
spendguard init — a few quick prompts (or your AI assistant in Claude Code / Cursor runs it for you). Deterministic.spendguard init --chat — describe budgets in plain English; one tiny call on your own key, caged under caps.meta — never our server.Install itself is pip install llm-spendguard + two lines, or auto-gate a whole venv. Projects auto-tag from your git repos (deterministic).
extend
Tracks your coding agents — Claude Code and Codex — plus claude.ai, and the OpenAI and Anthropic APIs (batch, realtime, and the Responses API). Register any other SDK with one call, and emit every event to your webhook, OpenTelemetry, or a callback. Zero required dependencies — it never blocks your code.
for teams — the hosted dashboard (llmspendguard.com)
Point the OSS client at the dashboard and every gated machine's spend rolls into one team P&L — by org, team, project and contributor. Your keys and tokens never touch our servers; we ingest only scrubbed roll-ups and abstracts.
Mint a scope-bound key and your team’s Claude queries the aggregate — spend, coverage, efficiency and the team’s cost learnings — read-only, via the Claude API mcp_servers param or any MCP client. Governance agents consult before they spend.
Org → team → project → contributor, LLM + remote compute, any period (day → YTD). The website, the MCP and the CLI all read one data layer, so the numbers can never diverge.
The team’s cost lessons in one searchable corpus — hybrid vector + keyword — so a fix one engineer found is one query away for everyone. Opt into community learnings across orgs.
Per org / team / user keys with ingest · read · mcp caps — mint, rotate, revoke. Device-link binds a verified contributor, so seats derive from real usage, not a headcount guess.
Coverage-low and spend-spike emails to admins; per-user and per-project drill-down; one-click CSV export. The dashboard tells you when something drifts.
Scrubbed roll-ups and abstracts only — never prompts or tokens. Row-level tenant isolation; export or purge the whole org anytime. Open source, audit it yourself.
pricing
Open-source gate: free. Team dashboard: free up to 2 seats, then $1/seat/mo ($5 floor). Your keys, your tokens — always.