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. Observability tools tell you what you already spent — this runs before the tokens are billed.
Your ledger is diffed against the provider’s own billing, estimates are trued down to billed actuals, and the gap is NAMED as ungoverned spend instead of quietly absorbed. Batch reconciles exact; realtime measured at +4.4%. We publish the method and what we do not capture — nobody else in this category publishes a number at all.
An unknown model fails loud instead of logging $0. Elsewhere a $0 price can also silently exempt the call from your budget — an unknown model becomes an uncapped one.
Naive tokens×price misses in predictable ways — models rarely fill max_tokens, batch ≠ realtime. Calibration learned from your own captured history cuts the error, and the whole org shares it: statistics up, a better prior down, your local data always on top.
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.
GPU clouds through one port — vast.ai enforced from boot (fail-closed), RunPod, Modal and Lambda reconciled from their own billing. Unpriced or untimed rows stay visibly unknown, never $0-clean.
Thresholds are checked the moment spend data arrives — crossing 80% of your monthly cap fires the flare that instant, once, not on tomorrow’s schedule. No cron lag between the event and the email.
The open month projects itself — “month-end ~$X (p50) … $Y (p90)” from your own daily run-rate — and the dashboard prices the output: billed $ per shipped work-unit, per project.
The governor’s own thinking (insight synthesis, judging) can run on your flat-fee Claude plan instead of metered API — $0 billed, value counted on its own axis, automatic fallback if the plan is busy.
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.
Every channel recorded as it happens — chat, Responses, batch, streaming, embeddings, images, audio, TTS, per-call tool fees, even raw HTTP that skips the SDK. OpenAI, Anthropic, Gemini. 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.
Measured bounds surface on every call — your max_tokens vs the observed p99 — and opt-in autotune applies them: shrink-only, truncation-safe, logged, one flag to turn off.
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.Try it with no install at all: uvx --from llm-spendguard spendguard scan. Then pip install llm-spendguard and gate a job with spendguard run -- python job.py — that puts the gate on that one command; nothing is written into your interpreter and nothing persists. Auto-gating a whole venv is still supported, as an explicit opt-in. 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.