// guardrails for LLM spend

Put a fence around
every token.

TokenFence sets hard limits on AI usage per user, API key, and project. A runaway agent loop gets stopped, not billed.

project: support-bot812,400 / 1,000,000 tokens
warn
fence

Three lines between you and a surprise invoice

  1. 01

    Route through TokenFence

    Point your model calls at the TokenFence proxy. Nothing else in your app changes.

  2. 02

    Set your fences

    Daily, monthly, or per-request token caps for each user, key, or project.

  3. 03

    Sleep fine

    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

Per-user budgets

Give every end user their own allowance so one heavy user can't burn through everyone else's.

Key-level limits

Issue scoped keys to teams and contractors, each with its own cap.

Live usage

See token burn by model, project, and user as it happens.

Soft and hard fences

Warn at 80%, throttle at 95%, block at 100%. The thresholds are up to you.

Multi-provider

One set of limits across every model provider you use.

Audit trail

Every blocked request is logged with the reason, so nothing fails silently.

Be first behind the fence.

TokenFence is in early development. Reach out to join the early access list.

Request early access