Per-user budgets
Give every end user their own allowance so one heavy user can't burn through everyone else's.
// guardrails for LLM spend
TokenFence sets hard limits on AI usage per user, API key, and project. A runaway agent loop gets stopped, not billed.
Point your model calls at the TokenFence proxy. Nothing else in your app changes.
Daily, monthly, or per-request token caps for each user, key, or project.
Get a warning as usage nears a cap. Once a cap is hit, requests are blocked cleanly with a clear error.
# before
base_url = "https://api.provider.com/v1"
# after
base_url = "https://proxy.tokenfence.dev/v1" # fence: 1M tokens/day
Give every end user their own allowance so one heavy user can't burn through everyone else's.
Issue scoped keys to teams and contractors, each with its own cap.
See token burn by model, project, and user as it happens.
Warn at 80%, throttle at 95%, block at 100%. The thresholds are up to you.
One set of limits across every model provider you use.
Every blocked request is logged with the reason, so nothing fails silently.
TokenFence is in early development. Reach out to join the early access list.
Request early access