PlatformAgent Gateway

Cost scales with task difficulty, not with your most conservative default.

Every request has more than one capable model, at very different prices. The Agent Gateway optimizes your token spend by picking the right one every time: it classifies the task, scores quality against cost, learns from every outcome, and switches only at moments where switching is free.

02 · Decision layer

Gate · Classify · Score · Learn

01 · Dispatch layer

One API · Fallbacks · Allowlists · Keys · Limits · Spend

Two layers, one gateway: dependable dispatch beneath, an intelligent decision layer on top.

Every provider, one integration

A complete dispatch layer, out of the box: one API across every provider, automatic failover, controlled keys and limits, and spend visibility from the first request.

  • 01

    One API

    Every provider behind one consistent surface. Swap models without a deploy.

  • 02

    Fallback chains

    An ordered chain takes over when a model errors, times out, or is unavailable.

  • 03

    Provider sort

    Prefer balanced, lowest price, lowest latency, or highest uptime per deployment.

  • 04

    Wildcard allowlists

    Pattern rules over model names, with a live count of what currently matches.

  • 05

    Virtual keys

    Per-team keys, so provider credentials are never handed to callers.

  • 06

    Rate limits

    Request ceilings per key and team, enforced at dispatch.

  • 07

    Spend tracking

    Every call recorded with its cost, the raw feed TokenOps reads.

  • 08

    OTEL export

    Routing traces land in the observability stack you already run.

  • 09

    BYOK

    Provider credentials come from the credential manager, not from config files.

Four moves per request

Gate, classify, score, learn: four moves on every request. The scoring stage is live below, running the real formula with the weights in your hands.

  1. 01Gate

    Route only at clean boundaries.

    Model switches land at conversation start or an agent handoff, the moments a switch is free. Prompt-cache savings and tool context are preserved through every task.

  2. 02Classify

    Read the request without a model call.

    Deterministic patterns sort each request into one of seven task categories, code generation through factual lookup. Zero added latency, and accuracy you can inspect per category.

  3. 03Score

    Quality estimate versus cost pressure.

    Every eligible model carries a learned per-category quality estimate, blended with its normalised cost under controlled weights. New models start from declared tier and strengths, productive from the first request.

  4. 04Learn

    Outcomes update the estimate.

    Every decision is logged with its spend, and every outcome sharpens the estimate. Drift tracking keeps scores current as models evolve. The Agent Gateway gets better the more you run.

Scoring simulator

Balanced

Model tiers: learned quality estimate for the selected category, cost per million tokens, and the blended score. The highest score is routed.
ModelQ̂$ / 1MScore
nano-3Routed $0.40
mid-3Routed $4.20
max-3Routed $21.00
Routed
Gap to pay up (w_c / w_q)
vs always-max

score = w_q · Q̂(category) + w_c · (1 − cost̂). That’s the Agent Gateway’s real scoring rule. Drag the weights, switch the task, watch the choice change.

Routing is free only at boundaries

Switches land at exactly two moments, the first turn of a session or a formal agent handoff, because those are the moments a switch costs nothing. Four disciplines make that guarantee real.

01Cache economics

Every cached token keeps working.

Cached input runs up to 10× cheaper, and boundary discipline preserves the cache through the whole task, so the discount compounds instead of resetting.

02Tool continuity

Tool context stays whole.

The model that makes the tool calls is the model that finishes the task: full context, clean results, no retracing.

03Clean handoffs

Fresh context, by design.

Every switch lands exactly where a fresh reasoning context begins, so nothing is lost in the handover.

04Coherence

One voice per task.

Reasoning style stays consistent from the first token to the last, so your users see one seamless answer.

Precise by design

Boundaries come from your framework’s own lifecycle events, never guessed from conversation content. Every boundary decision is visible on the dashboard, live.

Routing that keeps getting smarter

Exploration-aware selection keeps re-testing every candidate, so a model that improves (or a new one you add) earns traffic on evidence. Naive greedy routing locks onto one model and stops looking; the Agent Gateway never does, and it wins on quality per dollar at every setting.

Quality per dollar by weight setting: greedy selection versus the Agent Gateway. Higher is better.
GreedyAgent Gateway

0.9 / 0.1

2.59 3.28

+27%

0.8 / 0.2

2.96 5.72

+93%

0.7 / 0.3

7.44 12.54

+69%

Quality per dollar, higher is better. The Agent Gateway wins at every weight setting, and at the default it spends 53% less doing it. Benchmark: 3,000 queries across two model tiers.

Per-team weights, not one global slider

One global dial can’t run a company. The Agent Gateway’s weights are set per team and per deployment, controlled like any other policy. Each setting is an explicit, predictable threshold for when extra quality is worth paying for.

Cost-first

Weights (Q / C)
0.7 / 0.3
Gap to pay up
0.43
Quality per dollar
12.54

Batch enrichment, tagging, backfills: tolerant work where the cheap model is almost always right.

Balanced

Default
Weights (Q / C)
0.8 / 0.2
Gap to pay up
0.25
Spend saved
−53%

Product surfaces with a human reading the output. What a team gets if it sets nothing.

Quality-first

Weights (Q / C)
0.9 / 0.1
Gap to pay up
0.11
Exploration
always on

Work where a weak answer costs more than the strong model does. The Agent Gateway pays up on an 11-point edge.

Candidate set
Registered models ∩ the runtime-controls allowlist. A blocked model is never scored, so policy runs upstream of the decision.
Budget headroom
w_cost tightens automatically as a team approaches its spend limit, instead of staying static while the budget burns.
Config lock
Routing config can be tightened by policy but never loosened by a caller.
One ledger
Every decision lands in the same spend ledger TokenOps monitors. The Agent Gateway is its acting arm.

What the Agent Gateway holds itself to

Five commitments, each one measurable on the dashboard, so trusting the Agent Gateway never has to mean taking its word for it.

  1. 01

    More quality per dollar

    Routing is scored against always-picking-the-strongest-model, continuously. The gap between the two lines is the product working.

  2. 02

    Every model stays in play

    Candidates keep getting re-tested, so a model that improves (or a new one you add) earns traffic on evidence, not on someone remembering to re-benchmark.

  3. 03

    Caches and tool state stay intact

    Switches happen only at clean boundaries, so prompt-cache discounts and tool continuity are never sacrificed to save a cent.

  4. 04

    Accuracy you can inspect per task type

    Classification is reported per category, never averaged away, so a weak class is visible the day it appears, with a tracked reason.

  5. 05

    Numbers that reproduce

    Every reported figure regenerates from committed code on demand, so an eval you read is an eval you can run.

Frequently asked questions

How is this different from LiteLLM or Portkey?

You get what those offer: one API for every provider, fallback chains, virtual keys, rate limits and spend tracking. The Agent Gateway adds choosing a model for each request. It sorts each request into a task type, scores quality against cost, and learns from the outcomes, so cost follows how hard the task is.

Won’t switching models break prompt caching?

No. The Agent Gateway only switches at clean boundaries: the start of a conversation or a handoff between agents. Cached input, which can be up to 10× cheaper, keeps its discount for the whole task, and the model that made the tool calls is the one that finishes the task.

Will a cheaper model hurt quality?

You set the trade-off per team and per deployment. Tolerant batch work leans cheap, and work where a weak answer is costly pays for the strong model. Results are continuously compared against always picking the strongest model, and accuracy is reported for each task type rather than averaged.

What happens if routing fails?

The call goes through anyway. If routing misses, Nasiko falls back to the best candidate model instead of failing the call.