Observed since 20 Oct, 21:37 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
LLM API cost interceptor and budget enforcer for AI agents
Stop overpaying for the wrong model.
agentcents sits between your agent and any LLM. Before each call it forecasts the cost as an honest range — measured input, estimated output, per candidate model — tracks every cent you actually spend, and proves its own forecasting accuracy on a calibration page. Point your client at it. Change nothing else.
pip install agentcents
No API keys. No accounts. No code changes beyond one base URL.
The release where agentcents stops just watching and starts forecasting:
agentcents explain — EXPLAIN COST for an LLM call. Pipe a request in,
get every candidate model priced as a p50 → p90 range before you spend.
Input tokens are measured; output tokens are estimated from your own workload's
histogram — and when two candidates swap rank inside the range, the decision is
flagged unstable instead of pretending to certainty./explain) — every proxied call silently logs its forecast
next to what it actually cost. Coverage gauges, q-error, and a per-call
calibration strip show whether the estimator has earned your trust.
agentcents explain --accuracy gives the same report in the terminal./orchestrator) — the plan-chooser, shown before it binds:
per-node routing decisions, each gated by robustness, a capability quality floor,
tool-use and provider-boundary rules. Advisory today; auto-apply only unlocks once
the calibration page shows the forecasts hold.prompt_tokens_details, Anthropic cache_read/creation_input_tokens) are now
priced correctly. Previously, heavily-cached traffic was over-counted by the
cache discount; ledgers are accurate from this release forward.Most agents pick one frontier model and use it for everything — classifying, retrieving, the hard reasoning step, the trivial cleanup step. The easy steps don't need a frontier model. You're paying Opus-4.8 prices to decide whether a message is a question or a complaint.
agentcents shows you, per step, what you pay and what you could pay — then routes each step to the cheapest model that clears the bar. In a typical 7-step task:
all-Opus-4.8 $0.114 → cost-routed $0.055 — 51% cheaper, keeping the flagship only where the work demands it.
A local proxy sits between your agent and the LLM provider. You point at it; it does the rest — identifies each task (no tagging required), prices it against every current model, checks capability, and shows you the plan.
your agent → agentcents (localhost:8082) → any LLM provider
pip install agentcents — Python ≥ 3.9agentcents start — the local proxy comes up on port 8082agentcents usage — see exactly where every cent wentCost tools that auto-route on day one are asking you to trust an estimator you've never seen graded. agentcents does it in the order an engineer would:
1 · Forecast. agentcents explain prices a request on every candidate model
before it runs. The parts that can be measured are measured (your prompt's tokens,
known cache state); the part that can't — how much the model will say — is an honest
p50 → p90 range learned from your own traffic, never a falsely precise point.
$ echo '{"model":"gpt-4o","messages":[...]}' | agentcents explain --tag whatsapp
CANDIDATE TOTAL p50→p90 note
ollama/local $0.000015 → $0.000018 ← pick · util 12%
openai/gpt-4o-mini $0.000294 → $0.000498
openai/gpt-4o $0.004900 → $0.008300 requested
2 · Calibrate. Every call through the proxy silently logs its forecast next to
the actual. The /explain calibration page — and agentcents explain --accuracy —
grade the estimator in public: p90 coverage against its 90% target, q-error against
1.00, one candle per call on the calibration strip. You watch the forecasts earn
their keep on your workload, not a benchmark.
3 · Orchestrate. The /orchestrator page shows the plan-chooser's per-node
decisions, each passing five gates: robustness (a swap binds only if it's
cheapest across the whole forecast range), a quality floor (never route below the
node's capability bar), tool-use and provider-boundary safety, and the
trust gate — binding requires the calibration page to prove the forecasts first.
Advisory today, by design. The switch flips when the evidence does.
Every dashboard page carries ✦ two cents: ask about your spend, your calibration, your tags, or how anything on screen works, in plain language.
What makes it different from the AI assistant in every other tool:
Zero-config — wrap your run:
agentcents run -- python my_agent.py
agentcents sets the base URLs, groups the run into one session, and gets out of the way. Your agent code is untouched.
Or one env var:
export OPENAI_BASE_URL="http://localhost:8082/openai"
python my_agent.py
Or one line in code:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8082/openai")
# everything else stays exactly the same
Already setting your own session or tag headers? agentcents recognizes the common
ones (X-Session-ID, X-Request-ID, and more) automatically. The proxy adapts to
your client — never the other way around.
It doesn't just log. It advises.
$ agentcents usage
─────────────────────────────────
Total spend (last 48h) $3.42
my-agent $2.10 61%
research-agent $1.32 39%
─────────────────────────────────
Daily budget $5.00
Remaining $1.58
$ agentcents explain --accuracy
MODEL TAG N p90 cov q-err med
ollama/gpt-oss:20b my-agent 212 92% 1.18
overall: p90 coverage 92% (target ~90%), median q-error 1.18
Other commands: agentcents explain (pipe a request in), agentcents models,
agentcents sync, agentcents agents, agentcents rolling, agentcents local,
agentcents features.
Anything that speaks the OpenAI or Anthropic format: OpenAI, Anthropic, Google Gemini, OpenRouter, Groq, and local Ollama. Pricing syncs automatically on proxy startup from public catalogs, with current frontier prices carried in a bundled config the aggregators lag on.
Free forever — no account needed:
agentcents explain) + calibration pagePro — one-time license (agentcents activate <key>):
For Pro dependencies: pip install 'agentcents[pro]'.
Get Pro: https://labhamfounder.gumroad.com/l/agentcents-pro
agentcents is proprietary software, © Labham LLC. All rights reserved. The source is
distributed for transparency and inspection; use is licensed, not sold. See
LICENSE.txt for terms. Pro features require a valid license key.
Contact: founder1@labham.com · https://labham.com
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.1.3 | 24 Jul 2026 | 9 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:37 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:730692075df7a8e3f119084e0c8615df6d8aad3da3ee1005a4e468505840147c