































































Route on the attributes your request already carries: plan, priority, and workflow. Escalations hold the frontier model. Free-plan traffic drops a tier, with a failover chain behind it.
curl 'https://app.operantlabs.com/api/routers' \
-H "Authorization: Bearer $STRATA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"displayName": "User-Aware",
"routes": [
{
"condition": {
"cel_expression": "language == \"es\""
},
"route": {
"variants": [
{ "variant": { "modelId": "openai/gpt-5.2" }, "weight": 100 }
]
}
},
{
"condition": {
"cel_expression": "plan == \"free\""
},
"route": {
"variants": [
{ "variant": { "modelId": "anthropic/claude-haiku-4-5" }, "weight": 100 }
]
}
}
],
"defaultRoute": {
"variants": [
{ "variant": { "modelId": "anthropic/claude-sonnet-4-6" }, "weight": 100 }
]
}
}'curl 'https://app.operantlabs.com/api/routers' \
-H "Authorization: Bearer $STRATA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"displayName": "User-Aware",
"routes": [
{
"condition": {
"cel_expression": "language == \"es\""
},
"route": {
"variants": [
{ "variant": { "modelId": "openai/gpt-5.2" }, "weight": 100 }
]
}
},
{
"condition": {
"cel_expression": "plan == \"free\""
},
"route": {
"variants": [
{ "variant": { "modelId": "anthropic/claude-haiku-4-5" }, "weight": 100 }
]
}
}
],
"defaultRoute": {
"variants": [
{ "variant": { "modelId": "anthropic/claude-sonnet-4-6" }, "weight": 100 }
]
}
}'Route on the attributes your request already carries: plan, priority, and workflow. Escalations hold the frontier model. Free-plan traffic drops a tier, with a failover chain behind it.
A gateway fee is not where your money goes. A model call costs tokens times price per token. Cache shaping and compression cut the tokens; learned routing cuts the price. They are independent levers, and they multiply. Agents re-send the whole conversation every turn, and a provider will bill that re-used prefix at about 0.1x, but only if the request marks where the prefix ends. Most agents do not. Operant places the cache_control breakpoints itself: after the stable tools and system block, and at the tail of the history. Additive only, so no reordering, no content change, and callers that already set breakpoints are left untouched. Measured, not assumed: the ledger attributes exactly the tokens read from cache because of those breakpoints.
View pricing
A gateway fee is not where your money goes. A model call costs tokens times price per token. Cache shaping and compression cut the tokens; learned routing cuts the price. They are independent levers, and they multiply. Agents re-send the whole conversation every turn, and a provider will bill that re-used prefix at about 0.1x, but only if the request marks where the prefix ends. Most agents do not. Operant places the cache_control breakpoints itself: after the stable tools and system block, and at the tail of the history. Additive only, so no reordering, no content change, and callers that already set breakpoints are left untouched. Measured, not assumed: the ledger attributes exactly the tokens read from cache because of those breakpoints.
View pricing
Pass plan, priority, or task category as metadata. CEL rules on a named router evaluate in order. The first match wins and picks the smallest model that can do the work. Work that keeps recurring moves to a cheaper model carrying the skill it needs. That rule runs in shadow first, is replayed against the frontier answers, and takes traffic only once the gate passes and you ratify it. Change a rule without a deploy.
Pass plan, priority, or task category as metadata. CEL rules on a named router evaluate in order. The first match wins and picks the smallest model that can do the work. Work that keeps recurring moves to a cheaper model carrying the skill it needs. That rule runs in shadow first, is replayed against the frontier answers, and takes traffic only once the gate passes and you ratify it. Change a rule without a deploy.
Point your base URL at app.operantlabs.com and swap in an Operant key. Operant speaks the Anthropic and OpenAI wires, so whatever already talks to a model can talk to Operant. Address a router by name, as router/standard, and the gateway chooses the model per turn, with deep, standard and fast seeded on day one. Streaming is preserved. Operant observes only until you turn on a lever.

from openai import OpenAIclient = OpenAI(base_url="https://api.openai.com/v1"base_url="https://app.operantlabs.com/v1")
Point your base URL at app.operantlabs.com and swap in an Operant key. Operant speaks the Anthropic and OpenAI wires, so whatever already talks to a model can talk to Operant. Address a router by name, as router/standard, and the gateway chooses the model per turn, with deep, standard and fast seeded on day one. Streaming is preserved. Operant observes only until you turn on a lever.

from openai import OpenAIclient = OpenAI(base_url="https://api.openai.com/v1"base_url="https://app.operantlabs.com/v1")
Split traffic between the frontier model and a cheaper routed variant. Sticky by user_id, with per-variant failover. The eval gate replays held-out exemplars and picks the winner: 12 of 12 at parity judged by claude-opus-4-8, cost per conversation $0.55 against $0.14, a saving of $0.41 or 75 percent. Ramp it to 100%, or demote in one click.
A/B testing docsSplit traffic between the frontier model and a cheaper routed variant. Sticky by user_id, with per-variant failover. The eval gate replays held-out exemplars and picks the winner: 12 of 12 at parity judged by claude-opus-4-8, cost per conversation $0.55 against $0.14, a saving of $0.41 or 75 percent. Ramp it to 100%, or demote in one click.
A/B testing docsEvery call through the gateway carries a POTENTIAL / ACTUAL / SAVED decomposition. POTENTIAL is what the work would have cost without Operant, and ACTUAL is what it cost. SAVED is the difference, split by lever. Rolled up, one conversation reads: without Operant it would have cost $2.41; it cost $0.87, which is $1.54 saved, or 64 percent. The assumptions are explicit, so an independent party can recompute them. Spend charts are not proof. Arithmetic is.

{"model": "router/support-agent","potentialUsd": 0.0412,"actualUsd": 0.0121,"savedUsd": 0.0291,"levers": ["routing", "cache"],"reason": "learned rule · skill v3"}
Every call through the gateway carries a POTENTIAL / ACTUAL / SAVED decomposition. POTENTIAL is what the work would have cost without Operant, and ACTUAL is what it cost. SAVED is the difference, split by lever. Rolled up, one conversation reads: without Operant it would have cost $2.41; it cost $0.87, which is $1.54 saved, or 64 percent. The assumptions are explicit, so an independent party can recompute them. Spend charts are not proof. Arithmetic is.

{"model": "router/support-agent","potentialUsd": 0.0412,"actualUsd": 0.0121,"savedUsd": 0.0291,"levers": ["routing", "cache"],"reason": "learned rule · skill v3"}
A coding agent session is not one conversation. It is a main thread, a handful of sub-agents, and the sidecar calls the harness makes on its own: title, permission classifier, compaction. Operant captures the whole tree from what the harness already sends, with no wire change. Point one env var at the gateway and Claude Code works as before, call for call: plan steps go up to the deep model, mechanical steps to the fast one, and the rest falls through.
A coding agent session is not one conversation. It is a main thread, a handful of sub-agents, and the sidecar calls the harness makes on its own: title, permission classifier, compaction. Operant captures the whole tree from what the harness already sends, with no wire change. Point one env var at the gateway and Claude Code works as before, call for call: plan steps go up to the deep model, mechanical steps to the fast one, and the rest falls through.

Capability | Direct provider APIs | Operant | Gateways and routers |
|---|---|---|---|
Models reachable | One provider per key | Every model your provider keys already reach | Many, behind one API |
Install cost | Rewrite per provider | One base URL, observe-only | One base URL |
Cache engagement | Off unless you code it | Placed and measured per call | Varies by vendor |
Cache-aware routing | Not applicable | Prices the per-model cache a model switch would forfeit | Varies by vendor |
Learned skills | Not applicable | Versioned, with provenance | Varies by vendor |
KV-safe compression | Not applicable | Cache-cooperating, on a rule | Varies by vendor |
Per-call cost ledger | Provider invoice only | Per call, per lever, stated as estimates | Spend charts |
SDK compatibility | Native | OpenAI and Anthropic, byte-identical passthrough | Varies by vendor |
Change control | None | Manual and learned; shadow, then gate, then ratify | Varies by vendor |
Weights you own | Hosted endpoints only | Phase 4 Proven skills distilled into models served in your VPC | Hosted models only |
Every call carries what it cost, what the same work would have cost without Operant, and the difference. A CFO can recompute the arithmetic. It is not a dashboard.
The per-call ledger in the Operant console · demo dataset
