TokenLX

Automatically balance cost and quality for every request

Reads task difficulty and context to match the right model in real time.

76–85%
Max inference cost savings
>95%
Stable experience
GDPR
Global compliance

Still routing every request through one flagship model?

More traffic, faster bills — and with tasks of every difficulty, cost and quality are hard to hold steady.

Bills that keep climbing

Even simple Q&A hits your priciest flagship — the more you scale, the harder spend is to control.

Quality you can't balance

Static mappings miss task difficulty — you overspend where you shouldn't and underdeliver where it counts.

Runaway agent costs

Every step of a multi-turn call on a flagship — costs multiply once the workflow runs.

One router, two engines

Two decoupled engines: "how hard is this request?" and "which step is the agent on?"

Vertical · Difficulty routing

Gauges each request's difficulty: simple → economy, complex → flagship,
sensitive → safety — scored in ~0.1ms.

Simple task
Economy modele.g. DeepSeek / Qwen
Complex task
Flagship modele.g. GPT / Claude Opus
Sensitive request
Safety modele.g. Safety / Moderation

Horizontal · Stage downgrade

Tracks the agent's stage: strong models for planning, automatic downshift for execution and wrap-up.

PlanExecute / ObserveWrap-up
01
Receive the request
Requests enter through your existing endpoint — no call changes, just smart routing.
02
Safety scan & session lock
Jailbreak or PII routes to a safety model; first-turn choice locks for 30 minutes per session.
03
Feature extraction
Thousands of features decode intent — code, reasoning, tool calls, and more.
04
Score & select
Each candidate is scored; the best value pick follows your cost / quality preference.
05
Execute & return
Returns results with routed model, latency, and cost in response headers — fully traceable.
01Vertical engine

Routing pipeline for every request

Every request runs a self-healing pipeline — safety and quality checks along the way, automatic fallback at any stage.

< 5%
Quality fallback rate — on risk or model failure, traffic reverts to a steadier flagship automatically.
02Horizontal engine

Match the right compute to every agent turn

Ordinary gateways miss multi-turn agent reasoning. This engine detects each stage — strong models only where it matters, downshift in between.

76–85%
Call-cost reduction on a typical 6-step task
Flagship modelMid-tier modelEconomy model

Per-step savings are estimates for a typical 6-step task; actual results vary by workload and models.

01
Task planningPLAN
Flagship model sets direction — planning stays on track
Baseline
02
Execute callsOBSERVE
Switches to a cost-efficient mid-tier model
Save 78%
03
Read resultsREFLECT
Parsing and judgment — mid-tier handles it well
Save 82%
04
Keep goingOBSERVE
Multi-turn tool calls stay on mid-tier
Save 80%
05
Consolidate & verifyREFLECT
Aggregates step results and cross-checks consistency
Save 76%
06
Lightweight wrap-upSYNTHESIZE
Format output with a faster economy model
Save 97%

The cost difference, at a glance

Monthly spend under different routing strategies, based on 1 million calls per day.

No routing · straight to flagship
Baseline$420,000/mo
premium · quality first
Save 40%$252,000/mo
autoRecommended
Save 76%$100,800/mo
eco · cost first
Save 85%$63,000/mo

Based on tests in typical business scenarios, choosing auto or auto-eco mode can save up to about 76%–85% in costs.

A self-evolving routing flywheel

Beyond the numbers, it keeps improving — not hardcoded rules, but a loop that learns from your traffic and retrains itself.

Always learningSharper over time
1Real-time feedback

Every call reports real performance (latency, fallbacks) as optimization samples.

2Periodic review

Weekly, a stronger model re-grades calls and surfaces requests where experience fell short.

3Seamless updates

Qualified retrains roll out gradually and hot-swap in ~60 seconds — no service disruption.

Improved results feed back in — the loop keeps turning, no manual tuning.

Integrate in just two lines

Practically zero onboarding — keep your stack and the OpenAI calls you already use.

OpenAI-compatible
No new API to learn — just a drop-in replacement
model="auto"
One line enables smart routing — picks the model per scenario
auto-eco / auto-premium
Tune the cost-vs-quality trade-off to your team's preference
import openai

openai.api_base = "https://api.tokenlx.ai/v1"
openai.api_key = "YOUR_TOKENLX_API_KEY"

response = openai.ChatCompletion.create(
    model="auto",
    messages=[{"role": "user", "content": "Summarize this weekly report..."}]
)
# Auto selects the base model; Agent refines routing by stage
curl https://api.tokenlx.ai/v1/chat/completions \
  -H "Authorization: Bearer $TOKENLX_API_KEY" \
  -d '{
    "model": "auto-eco",
    "messages": [{"role": "user", "content": "Summarize this weekly report..."}],
    "tools": [...],
    # Pass agent_id to enable stage-based routing
    "agent_id": "tokenlx-my-agent"
  }'

You're in control — every step traceable

Fully automatic by default — as granular as you want, with every choice visible.

One line on, switch on demand
Default model="auto" balances cost and quality; switch to auto-eco / auto-premium for leaner or steadier — no other code changes.
Fine-grained control, routing on your terms
Set a model allowlist, pin a forced model, custom fallback chains and timeouts — routing stays within your bounds.
Fully observable, easy to reconcile
Every response returns the model used, latency, and cost — plus usage dashboard and logs for full traceability.

In production, it watches stability and safety for you

Model drift, node failures, quality anomalies — handled automatically. Your core business doesn't absorb third-party turbulence.

Automatic failure circuit-breaking

Repeated failures on one node trip the breaker for ~60 seconds; traffic returns smoothly once health checks pass — upstream hiccups don't reach your business.

Safety-valve protection

When fallback rates near the threshold, the safety valve closes in seconds and pulls traffic back to a flagship — protecting stability and experience first.

Pure pass-through data

Request data passes through end to end, never written to disk — aligned with GDPR compliance and security audits.

Bring Smart Routing into your app today

Create a key and start making requests right away — fully OpenAI-compatible.