Omri Arnon

tokencap - Track token usage and enforce budgets across your AI agents

by
tokencap tracks token usage and enforces budgets across your AI agents - per agent, per user, or any scope you choose. Two ways to add it: Direct SDK: tokencap.wrap(anthropic.Anthropic(), limit=50_000) Any framework: tokencap.patch(limit=50_000) WARN, DEGRADE, BLOCK, or WEBHOOK when budgets are hit. SQLite out of the box, Redis for multi-agent enforcement. Zero required dependencies. pip install tokencap

Add a comment

Replies

Best
Omri Arnon
Maker
📌
I was building AI agents and had no way to enforce token budgets at the code level - only coarse account-level caps at the provider. I wanted granular control: per agent, per user, any scope I needed. That gap became tokencap. Token-based enforcement that runs in your process, works with any framework, and blocks calls before they reach the provider when the budget is hit. Happy to answer any questions about the design.