Two ways to add it:
# Direct client wrapper
client = tokencap.wrap(anthropic.Anthropic(), limit=50_000)
# LangChain, CrewAI, AutoGen, etc.
tokencap.patch(limit=50_000)
Four actions at configurable thresholds: WARN, DEGRADE
(transparent model swap), BLOCK, and WEBHOOK. SQLite out of
the box, Redis for multi-agent setups.One design decision worth mentioning: tokencap tracks tokens, not dollars. Token counts come directly from the provider response and never drift with pricing changes.
Happy to answer any questions.