⚡ Up to 54.1% quality-gated token savings

The transparent token-savings layer

Compression Caching Routing Alignment Pruning

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.

FewerTokens per call
1-lineIntegration
~84%On cached prefixes
Apache-2.0Open-source core
One line. Zero rewrites.

Point your OpenAI, Claude or Gemini client at TokenLean

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.

  Before
client = OpenAI(
  api_key="sk-openai-..."
)
  After
client = OpenAI(
  api_key=os.environ["TOKENLEAN_KEY"],
  base_url=os.environ["TOKENLEAN_ENDPOINT"] + "/v1"
)  # that's it — fewer tokens, quality preserved
OpenAI SDK
/v1/chat/completions
Anthropic SDK · Claude Code
/v1/messages
Gemini SDK
:generateContent
How a request flows through TokenLean One base-URL swap · code unchanged · quality preserved Your app OpenAI · Anthropic Gemini SDK base_url = … 0 Native ingress any protocol → OpenAI shape, re-serialised back TokenLean optimisation pipeline 8 groups · 27 techniques ① Gate rate-limit · guardrails · PII cache read · route (3-tier) ② Request-side compress · RAG · tools prune · dedup · CCR ③ LLM-call params reasoning budget · format batch/TOON · loop budget ④ Cache alignment prefix-cache reorder up to ~84% on prefix LLM provider any OpenAI-compatible resilience layer breaker → retry → failover Response _token_opt per-call savings breakdown cache hit · G4 bypass → straight to response Trust & safety — runs first G30 injection guardrails · G29 PII redaction non-bypassable · covers cache & bypass traffic Provider failover — always on circuit breaker · retry · fallback provider one upstream outage never drops the request Every call measured Langfuse traces · Grafana · Prometheus per-call → quarterly savings dashboards
Under the hood

8 optimisation groups, 27 techniques — with safety & resilience built in

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.

Prompt compression

LLMLingua-2 strips redundant tokens from prompts while preserving meaning.

20–50% saved

Multi-level caching

Exact, semantic and response caches return answers without ever hitting the model.

30–80% saved

Smart model routing

A confidence-checked cascade sends easy calls to cheaper models, hard ones to bigger ones.

40–70% saved

Cache alignment

Reorders messages to hit provider prefix-caches — zero quality risk, large savings.

up to ~84%

Structured pruning & dedup

AST-aware compression of code/JSON/logs and collapsing of near-duplicate turns.

5–40% saved

Real-time savings tracking

Every response carries line-item token & dollar savings — fully auditable ROI.

Total visibility

Trust & safety

PII redaction (G29) and prompt-injection guardrails (G30) run non-bypassably before any tokens are spent — mask, flag or block per your policy.

Non-bypassable

Provider failover

Circuit breaker + retry + fallback provider keep requests serving when an upstream degrades — before any bytes reach the client.

Always-on
See it in action

The whole story, in one live console

TokenLean 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.

Every team sees exactly what they saved

Billed requests, tokens saved, dollars saved and average saving % — live, per tenant. Savings are disclosed estimates; you're only ever billed on request count.

app.cbeyond.cloud/portal
TokenLean portal — usage & savings dashboard with live token and cost savings

FinOps, built in

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.

app.cbeyond.cloud/portal · observability
TokenLean portal — AI FinOps: spend, projection, cost per request, savings ROI, cache hit-rate

Chargeback-ready, down to the user

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.

app.cbeyond.cloud/portal · usage
TokenLean portal — per-user token & cost explorer with requests-per-day chart

Tune every technique to your risk appetite

Toggle and dial each optimisation — compression aggressiveness, cache thresholds, routing confidence — and see changes apply within a minute. Savings vs. quality, on your terms.

app.cbeyond.cloud/portal · settings
TokenLean portal — optimisation settings for each G-group with tunable parameters

Your keys, your models, your spend cap

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.

app.cbeyond.cloud/portal · models & keys
TokenLean portal — models & keys: BYOK provider keys, model preferences, monthly spend cap

Security you can actually watch

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.

app.cbeyond.cloud/portal · trust & safety
TokenLean portal — Trust & Safety tab: per-day event trend and PII / injection incident log

Billing with nothing hidden

Six months of invoice history, billed purely on request count — with the value you saved shown right alongside, and never added to the bill.

app.cbeyond.cloud/portal · invoices
TokenLean portal — invoice history billed on request count with value-saved shown
Real screens from the TokenLean console · click any view to open it full-size
Proof, not promises

Every call reports exactly what it saved

  • Per-call and per-technique token-savings breakdown
  • Multi-tenant by default — per-team limits & config
  • Self-host or run managed — scales to near-zero when idle
  • Sits in front of, or inside, any existing LLM gateway
  response._token_opt
{
  "baseline_tokens": 450,
  "final_tokens_sent": 220,
  "total_abs_saving": 230,
  "total_pct_saving": 51.1,
  "cache_hit": false,
  "routed_model": "gpt-4o-mini"
}
TokenLean savings dashboard — per-call token breakdown
tokenlean/img/dashboard.png Observability dashboard · savings metrics & per-technique breakdown
Recommended: 900 × 500 px
Pricing

Start free. Scale when you're ready.

Self-host the open-source core at no cost, or let us run it for you — fully managed.

Self-hosted

Free

Open-source · Apache-2.0 · $0
The complete engine, yours to run. Deploy on your own infrastructure and keep full control of your data, keys and spend — no vendor in the loop.
  • All 27 optimisation techniques
  • Drop-in OpenAI-compatible proxy
  • Runs entirely on your own infrastructure
  • Full savings & observability data — you own it
  • Community support
View on GitHub →
Fully managed SaaS

Enterprise

Hosted & managed · contact us for pricing
Everything in Free, run for you as a service. We host, scale, secure and operate TokenLean so your team captures the savings on day one — with zero infrastructure to build or maintain.
  • Run for you
  • Zero-ops, zero infrastructureWe deploy, patch and upgrade for you — no proxy to run, no on-call, no maintenance.
  • Elastic auto-scalingScales to zero when idle, bursts to peak instantly — you pay for savings delivered, not idle servers.
  • 99.9% SLA-backed reliabilityUptime commitment backed by circuit breakers, retries and automatic failover across 10 providers.
  • The console — Enterprise exclusive
  • Self-service portal & AI-FinOps dashboardsLive savings, month-end spend projections, cost-per-request, cache ROI and anomaly alerts.
  • Chargeback & invoicing built inPer-user, per-model and per-provider cost rollups, one-click chargeback CSV, monthly invoices.
  • Spend caps & request quotasHard monthly USD ceilings and per-tenant quotas stop runaway usage or a leaked key cold.
  • Enterprise-grade security
  • BYOK — encrypted key vaultYour provider keys stored encrypted (Cloud KMS-wrapped master key), instant cross-instance revocation, self-serve rotation.
  • Managed trust & safetyPII redaction and injection guardrails with a live incident log — plus a continuously updated red-team ruleset feed.
  • Immutable audit trail, SOC 2 evidence & GDPR toolingTamper-evident 365-day audit log; downloadable SOC 2 evidence pack; one-click data export and right-to-erasure.
  • Hard multi-tenant isolationPostgres row-level security, tenant-scoped caches and signed upload URLs — no tenant ever sees another's data.
  • Partnership
  • Dedicated support & onboardingPriority support and a success engineer to tune your pipeline and maximise realised savings.
New features arrive here first — and stay Enterprise-only. Upcoming capabilities such as SSO / RBAC and deeper compliance controls ship to the Enterprise tier exclusively.
Contact us for pricing →
Early access · limited spots

Partner with us — before everyone else

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.

🚀 Founding-partner offer

A significant discount for coming in early

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:

  • Founding-partner pricingA substantial, locked-in discount that rewards you for partnering with us early.
  • Direct influence on the roadmapYour use case shapes what we build and prioritise next.
  • White-glove onboardingA direct line to the founders and hands-on help tuning your pipeline for maximum savings.