Monitor every AI dollar. Control it in real time.
TokenPolice is an SDK that sits inside your app, in front of every LLM call. It prices the call before it is made and checks it against your rules — block this user after $5 a month, tell me when AI Search passes $100 a week, send free users to a cheaper model — then lets it through, reroutes it, or refuses it.
A few decisions you should know about before you install anything:
- Dry-run is the default. Nothing is blocked until you say so. The first thing you see is a report of what a rule would have stopped, per user and per run, with the dollar amount.
- Fail-open. If our service is down or slow, your call proceeds untouched. The firewall can fail; your app can't.
- Not a proxy. It's OpenTelemetry instrumentation in your process. Token counts, cost, tags and a structural fingerprint per message (for loop detection) leave your server. Prompt and completion text never do — there is no field on the wire for it.
npm install token-police # Node 20+
pip install token-police # Python 3.10+Or let your coding agent do it and verify the integration from real traces:
claude plugin marketplace add tokenpolice/skills
claude plugin install tokenpolice@tokenpolice| Repo | What it is |
|---|---|
| token-police-node | Node SDK (token-police on npm) |
| token-police-python | Python SDK (token-police on PyPI) |
| token-police-langchain-node | Optional LangChain companion for Node |
| skills | Claude Code plugin + Agent Skill that installs and verifies the SDK |
- Site: https://tokenpolice.ai
- Docs: https://tokenpolice.ai/docs
- Live demo, no signup: https://tokenpolice.ai/demo
- Free while we launch. Pricing: https://tokenpolice.ai/pricing
Questions, bugs, or "it did nothing in my app": open an issue on the SDK repo or write to support@tokenpolice.ai.