Kingdom of KumarBack to home

Lab · MCP · Cost control

TokenGuard

A runaway agent loop can burn a shared API quota in minutes. TokenGuard puts a per-agent budget in front of chat completions: soft alert at 80%, hard stop at 100% with HTTP 429.

Demo (no API key required)

Stop the bill before it posts.

A proxy that sits between your agents and the model API, keeps a running tally in tokens and dollars, and cuts the line at the limit.

Pass-through mode (your own key)

If filled, calls go to the server’s OPENAI_BASE_URL with your key and cost real money. The key is sent only as this request’s Authorization header; TokenGuard does not store or log it. Leave empty for the free simulated demo.

Mode: demoNo model is called. A mock upstream echoes your prompt and reports deterministic, simulated token counts derived from prompt length. The accounting, soft alert and 429 are the real code paths.
Not armed—
0soft alerthard stop
Used
—
Input tok
—
Output tok
—
Calls
—
Blocked
—

Arm a budget on the left. A small limit like $0.05 trips within a few calls at the demo price table.

Budgets here live in server memory and are shared by every visitor to this instance. Name yours something unique.

Pricing

Starter

$29/mo

Start $29/mo

Team

$79/mo

Start $79/mo

Compared to LiteLLM, Portkey and Helicone

TokenGuard is a hard stop, not a full observability suite or a multi-provider gateway. Sourced prices and who should pick which:

Repo: github.com/Rupesh7128/kok-tokenguard. Proxy path: /api/lab/tokenguard/v1/chat/completions.

Prepared by Mayank Raj · Kingdom of Kumar Lab. Demo prices are placeholders so a small budget drains visibly — set TOKENGUARD_PRICES for real models.