A drop-in proxy that applies 27 optimisation techniques to every LLM call — sending fewer tokens for the same result, with a single line of code, no change to how your developers work, and quality preserved.
TokenLean speaks the OpenAI, Anthropic (Claude Code) and Gemini APIs natively. Swap your base URL — your code, prompts, SDK and even tool-calls stay exactly the same. TokenLean optimises every request before forwarding it to any of 10 first-class providers.
client = OpenAI( api_key="sk-openai-..." )
client = OpenAI( api_key=os.environ["TOKENLEAN_KEY"], base_url=os.environ["TOKENLEAN_ENDPOINT"] + "/v1" ) # that's it — fewer tokens, quality preserved
/v1/chat/completions
/v1/messages
:generateContent
TokenLean organises 27 techniques into 8 groups, layering a full pipeline of token-reduction strategies onto every call — each one measured, each one optional — and wraps every request in non-bypassable trust-&-safety and provider-failover layers. Because optimisation without measurement is guesswork.
LLMLingua-2 strips redundant tokens from prompts while preserving meaning.
20–50% savedExact, semantic and response caches return answers without ever hitting the model.
30–80% savedA confidence-checked cascade sends easy calls to cheaper models, hard ones to bigger ones.
40–70% savedReorders messages to hit provider prefix-caches — zero quality risk, large savings.
up to ~84%AST-aware compression of code/JSON/logs and collapsing of near-duplicate turns.
5–40% savedEvery response carries line-item token & dollar savings — fully auditable ROI.
Total visibilityPII redaction (G29) and prompt-injection guardrails (G30) run non-bypassably before any tokens are spent — mask, flag or block per your policy.
Non-bypassableCircuit breaker + retry + fallback provider keep requests serving when an upstream degrades — before any bytes reach the client.
Always-onTokenLean isn't a black box. Every optimisation, every dollar and every guardrail event is visible to your team in a multi-tenant portal — from real-time savings to per-user chargeback and security you can audit.
🔒 Enterprise exclusive — this console ships with the managed Enterprise plan, not the free self-hosted version.
Billed requests, tokens saved, dollars saved and average saving % — live, per tenant. Savings are disclosed estimates; you're only ever billed on request count.
Month-to-date spend, a month-end projection, cost per request, savings ROI and cache hit-rate — with a daily tokens-saved trend. Your LLM unit economics, at a glance.
Break requests, tokens and cost down by user, model, provider or day. Hand finance a clean showback for every team and every bot — no spreadsheets required.
Toggle and dial each optimisation — compression aggressiveness, cache thresholds, routing confidence — and see changes apply within a minute. Savings vs. quality, on your terms.
Bring your own provider keys (stored encrypted), pick per-tier models for the routing cascade, and set a hard monthly spend ceiling that stops runaway or leaked-key costs cold.
A per-day trust-&-safety trend plus a live incident log — every PII redaction (G29) and blocked injection (G30), by type and action. Metadata only; the matched content is never stored.
Six months of invoice history, billed purely on request count — with the value you saved shown right alongside, and never added to the bill.
{
"baseline_tokens": 450,
"final_tokens_sent": 220,
"total_abs_saving": 230,
"total_pct_saving": 51.1,
"cache_hit": false,
"routed_model": "gpt-4o-mini"
}
Self-host the open-source core at no cost, or let us run it for you — fully managed.
We're opening TokenLean to a select group of early-access customers ahead of general availability. Come in now and you're not just a user — you're a founding partner shaping the product, on terms that reward you for it.
We're keeping the first cohort deliberately small so every partner gets real attention. In exchange for working with us to make TokenLean better, early-access customers lock in pricing — and access — that won't be offered again: