Skip to main content
Docs

One endpoint,
every model.

Tare is an OpenAI-compatible gateway in front of every model you use — ours and the ones you bring yourself. One base URL, one key, and every token accounted for.

Upstream channelsRouting

Routing

What this solves: Have a public model name answered by the channel you choose, and set up the primary/backup order, the traffic split, and failover.

Routing decides which channel answers a given model name.

Callers only know:

Code / Terminal
{
  "model": "GLM 5.1",
  "messages": [...]
}

What routing decides is:

Code / Terminal
GLM 5.1
  ↓
openrouter-prod / z-ai/glm-5.1
  ↓
If it fails, fall back to the backup channel

Adding a channel only connects the upstream account. To send real traffic through this channel, you must create a route on the Routing page.

Console entry point: Routing.

What a route contains

When you add a route, you fill in these fields:

FieldMeaning
ModelThe model name callers use when they request Tare
Upstream nameThe model name the upstream actually recognizes
ChannelThe channel this route goes through
Tier / PriorityPrimary or backup
WeightTraffic share within the same tier
EnabledWhether it is enabled

Example:

Code / Terminal
Model = GLM 5.1
Channel = openrouter-prod
Upstream name = z-ai/glm-5.1
Tier = Primary
Weight = 1

This means: when a caller requests GLM 5.1, Tare sends it to openrouter-prod and changes the upstream model name to z-ai/glm-5.1.

The difference between Model and Upstream name

This is the most confusing part of routing.

NameWho sees itExample
ModelYour service, your downstream users, the Tare APIGLM 5.1
Upstream nameThe upstream providerz-ai/glm-5.1

If both names are the same, you can leave Upstream name empty to mean "use the same name".

If the upstream is an aggregator gateway, it is usually best to explicitly select or enter the upstream model name, so that a misspelled model name is caught early, rather than only at call time.

Configure the simplest route

Prerequisite: you have already added a channel on the Channels page and it passed the test.

  1. Open Routing.
  2. Click Add route and fill in Model, for example GLM 5.1.
  3. Select Channel, for example openrouter-prod.
  4. In Upstream name, select or enter the upstream model, for example z-ai/glm-5.1.
  5. Set Tier to Primary.
  6. Leave Weight at 1.
  7. Click Add.
  8. Send one real request with a business key to verify.

Override a platform default model

If the Model name you create is the same as a platform default model, your own route takes over first. The platform route does not disappear; it stays behind as a fallback: if your provider fails, this model does not go down with it.

Example:

Code / Terminal
Platform already has: GPT-5.6 Sol
You add: GPT-5.6 Sol -> openrouter-prod / openai/gpt-5.6

After that, when you call GPT-5.6 Sol, it goes through your channel first. If your channel fails, the platform default model may still serve as a fallback, depending on that Router's platform model switch.

Which upstream sits behind a platform default model is managed by the platform and can change without notice. If you need to control it, add your own route under the same name.

Route to a Tare model

In the Channel dropdown, Tare sends the route to one of the platform default models, which you pick as the target. You don't need a channel of your own for this. Use it to:

  • put a Tare model in the same tier as your channels and split traffic by weight, or make it the primary or the fallback;
  • give a Tare model a name of your own. For example, calls to fast go to qwen/qwen3.7-flash.

Calls are charged at the Tare price of the target model, also under a name of your own. Usage records show the name you called. The weight you give the row covers Tare as a whole.

Priority / Tier

Priority is the primary/backup order; the smaller value goes first. The console shows it as the easier-to-read Tier:

TierMeaning
PrimaryPrimary tier, tried first
Fallback 1First backup tier
Fallback 2Second backup tier

A single model can have multiple routes:

Primary and backup tiers One public model name is tried Primary, then Fallback 1, then Fallback 2. The next tier is used only when the current tier is entirely unavailable. One model name, tier by tier Try main All down All down GLM 5.1 The name the caller requested Primary tier openrouter-prod Fallback 1, first backup gateway-sg Fallback 2, second backup local-node-office Choose New fallback, or omit priority. New tier after the highest. Primary traffic stays put.
Routing primary and backup tiers

Only when the current tier is entirely unavailable does it move to the next tier.

If you add a route and choose "New fallback", or do not specify a priority, it lands in a new tier after the current highest tier, never 0, so it never quietly steals primary traffic. Adding a fourth backup will never silently steal traffic from the three already running.

Weight

Weight only applies within the same Tier, and is used to split traffic.

Example:

Code / Terminal
Primary:
  openrouter-a weight = 9
  openrouter-b weight = 1

This roughly means that out of 10 sessions, 9 go to openrouter-a and 1 goes to openrouter-b.

Traffic is split by session, not by individual call: one session (one conversation) stays on the same channel, so upstream and subscription caches hit more often. It moves to another channel in the same tier only when its channel fails, its circuit opens or it sells out. A session is recognized by the X-Claude-Code-Session-Id, Session-Id or X-Session-Id header, or by prompt_cache_key, metadata.user_id or user in the body; Claude Code and Codex send these on their own. With none of them, the API key decides: calls with the same key go to the same channel.

Weight splits traffic inside one tier Inside one tier, weight splits traffic. A 9 to 1 pair sends about 9 of 10 calls to the first channel. A channel more than 3 times slower is down-weighted. Minimum weight is 1. Inside one tier, weight splits traffic Inside Primary, weight applies only in that tier openrouter-a weight 9 openrouter-b weight 1 About 9 of 10 sessions go to openrouter-a, and 1 to openrouter-b A channel 3x slower is down-weighted, so the live split is looser Minimum weight is 1. To pause a route, turn it off. 0 is not off.
Traffic split by weight within a tier

Note:

  • 9 to 1 is the same ratio as 90 to 10.
  • This assumes both channels are equally fast. When one channel is clearly slower than the fastest channel for the same model, the configured weight is scaled down proportionally (see "Automatic down-weighting of slow channels" below), so the traffic split you actually observe is looser than what you configured, even if neither channel is unhealthy.
  • The minimum Weight is 1.
  • Weight = 0 does not mean paused.
  • To pause a route, turn off Enabled instead of setting Weight to 0.

Smart arrangement

The Routing page supports one-click reordering for a model (open the model, then Fastest first or Cheapest first):

  • Sort by measured latency.
  • Sort by provider cost price.

It only runs once when you click it, and does not stay running. Routes added afterward do not get reordered automatically; you need to click again.

For the default Router, use:

Code / Terminal
POST /v1/routing/routes/arrange

For a named Router, use:

Code / Terminal
POST /v1/routers/{id}/routes/arrange

Route testing

A route can be tested on its own: open the model and choose Test from the route's ⋯ menu.

This test checks one more thing than a channel test does: besides checking the address, the credential, and the Dialect (the differences between providers' APIs), it also checks whether the upstream model name this route points to exists. The first three are the same three checks as in testing a channel; the last one is unique to routes.

Related operations:

OperationDefault RouterNamed Router
Test a routePOST /v1/routing/routes/{routeId}/testPOST /v1/routers/{id}/routes/{routeId}/test
Send a one-liner through a routePOST /v1/routing/routes/{routeId}/chatCorresponds to /v1/routers/{id}/...

These two diagnostic calls are not counted in your Tare bill and do not appear in Call Traces.

Parameter handling (Parameter rules)

The same model on a different upstream may accept different parameters: one ignores temperature, another rejects a value of thinking.type, a third wants output_config.effort set to one fixed value. You set this per channel and upstream model: on the Routing page, open the model and choose Parameter rules from the ⋯ menu of a route on your own channel.

Common parameters are listed in the channel's own API format, each with three options:

OptionEffect
As sentForwarded as the client sent it (default)
Don't sendNot forwarded to this upstream
FixedSet to the value you give, even when the client did not send it
ParameterFixed valuesUpstream field
temperature0–2temperature (Gemini: generationConfig.temperature)
thinking.typeenabled / disabled / adaptivethinking.type; Don't send removes the whole thinking object
effortminimal / low / medium / high / xhigh / maxAnthropic output_config.effort, OpenAI reasoning_effort, Responses reasoning.effort
cache_controlDon't send onlyEvery cache_control in system, tools and messages; Tare also stops adding cache breakpoints for this route

For anything else, click + Field and give a field path (such as top_k or extra_body.enable_search): don't send it, fix it, or "Remove everywhere" (delete that key at any depth in system, tools and messages).

The rewrite runs on the request sent to that upstream, in its API format, and touches only the fields you set; message content is unchanged, and so are cache breakpoints unless you set cache_control. Tare may handle the same parameter by default; your setting takes precedence. Changes take effect within a minute. What was changed on a call shows in that call's parameter changes in Call Traces.

On channels whose API format is Anthropic, Tare can add cache breakpoints where the request has none: the last tool, the end of the system prompt, and the last message, at most 4 in total. This is off by default; to turn it on for a channel, edit the channel and check Add prompt cache breakpoints automatically. Breakpoints you send are kept as they are either way.

API: GET /v1/param-rules lists every rule you have set; PUT /v1/param-rules replaces the set for one channel and upstream model (an empty array clears it):

Code / Terminal
{"providerId": 12, "providerModelName": "claude-opus-4.7", "rules": [
  {"field": "temperature", "action": "DROP"},
  {"field": "output_config.effort", "action": "SET", "value": "high"},
  {"field": "cache_control", "action": "STRIP"}
]}

action is DROP (don't send), SET (fixed value), CALIBRATE (change it only when the client sent it) or STRIP; fields use the channel's API format.

Failover

A failed call almost always moves on to the next candidate. The one clear exception is when your own client disconnects halfway through the request. In that case the failover stops immediately; continuing would just generate an answer nobody will read.

What happenedMoves to the next channelCounts toward this channel's health
Client disconnectedNoNo
Malformed request 400 / 413 / 422YesNo
Credential rejected 401 / 403YesYes
Upstream has no such model 404YesYes
Upstream rate limited 429YesYes
Upstream 5xx or timeoutYesYes

The diagram below applies to candidate attempts before the first byte is returned. Once streaming content starts returning, there is no more failover; for billing after an interruption, see Billing rules.

After a failure, does the next channel run? Before the first byte, a failed try has three outcomes: a client disconnect stops failover, a bad request shape fails over without a health hit, and a provider-side failure fails over and counts toward health. After a failure, does the next channel run? Failed before first byte Client disconnected Stop. Do not switch. Not a health hit Bad request shape 400 · 413 · 422 Move on. Not a health hit. Provider-side failure 401 403 404 429 5xx timeout Move on, and count health Bad shapes still fail over. Some relays report their own outage as a plain 400. They are not a health hit. A bad client release should not park a good channel.
Whether a failure moves on to the next channel

Malformed requests still fail over. Some proxy providers also report a failure on their own upstream as an ordinary 400; judging "no failover" by status code alone would leave a perfectly healthy second channel sitting idle while your call fails outright.

But it does not count toward this channel's health: a batch of requests broken by your own bad release should not be enough to push a channel that has never actually had a problem into parked status.

There is no limit on the number of candidates a call will try. Four backups configured means four attempts; whether the extra few hundred milliseconds is worth it is your own trade-off when you add a fourth route. There is an emergency cap that is enabled only for a very small number of accounts with abnormal candidate configurations, off by default; for how billing works once it is hit, see Billing rules.

Every attempt can be seen in Call Traces: succeeded, blocked, failed, or never tried at all (which appears only when the emergency cap on the account is in effect).

Circuit breaker

A channel trips the circuit breaker after 5 counted failures:

  1. Cool down for 30 seconds first; no new traffic is sent during this time.
  2. When the cooldown expires, allow exactly one real request as a trial.
  3. If it succeeds, fully recover.
  4. If it fails, double the cooldown and wait again.
  5. The cooldown is capped at 300 seconds.
How a channel recovers after the breaker After 5 counted failures a channel opens its breaker. Cooldown starts at 30 seconds, doubles on each failed probe, and caps at 300 seconds. When cooldown ends, one real call is let through. Success restores the channel. How a channel comes back Healthy Sending new traffic Cooling down After 5 counted failures One probe Cooldown over, one call Fully restored Fail: doubles Cooldown starts at 30s, doubles on each failed probe, and caps at 300s. The probe is a real call. One cooldown allows at most one probe.
How a channel recovers after the circuit breaker trips

This trial is a real call. On a BYOK channel it uses your own credential; it sets max_tokens: 1 to keep the cost negligible, and it probes at most once per cooldown cycle, not on every check.

Without this, a channel that has recovered would stay locked out until real traffic happened to prove it works; for an account with only one channel configured, that would mean an outage that never ends on its own.

Automatic down-weighting of slow channels

Whether or not the caller passes provider.sort, a channel that is more than 3 times slower than the fastest channel for the same model is treated as if it were unhealthy: it sinks below normal channels but is never fully removed (a slow answer is better than no answer), and, per the weight note above, it gets only a smaller share of traffic within its own tier.

Two different health pages

PageEndpointWho can see itGranularity
Model HealthGET /v1/health/modelsEveryoneReports up / degraded per model
Channel healthGET /v1/health/channelsOnly BYOK channel ownersNames each of your own channels

Model Health's data comes from your own recent traffic, and it never names providers, because which providers sit behind a model is the platform's business information. On its own it only ever says up or degraded.

The parked state appears only on the channel health page. See "Viewing the health of your own channels" in Channels.

  • No traffic in the window means no data, not "healthy". A model you rarely call shows few samples.
  • A model is marked degraded when its failure rate in the window crosses the threshold. Requests to it are still routed.
  • A parked channel comes back on its own once a trial request succeeds (see "Circuit breaker" above).
  • The channel timeline shows when each channel went out of service and came back, not individual failed requests. Platform channels are not listed.
  • The pages refresh every 30 seconds.

Catch-all route

A route whose model name is * is a catch-all route; it handles all models that have not been configured by name, instead of returning "no route configured".

Upstream name has two meanings in a catch-all route:

Upstream nameBehavior
EmptyForwards the caller's requested model name to the upstream as-is
Filled inAll unconfigured models are answered by this one upstream model instead

A typical configuration for an aggregator gateway:

Code / Terminal
Model = *
Channel = openrouter-prod
Upstream name = (empty)

This way, when a caller requests an unconfigured model such as anthropic/claude-... or openai/gpt-..., the model name is passed to OpenRouter as-is.

Upstream name is a dropdown that lists the models you have configured on the selected channel (the ones with a recorded cost price, see Cost prices). A typo in this field does not raise an error: the route is still created, and the mistake only shows up when the upstream rejects the call. Choosing Something else… lets you type a name not in the list; private deployments and aliases are legitimate uses, and this path is always kept open.

The catch-all only applies when a model has no routes at all. When a model is configured but all its channels fail, the call fails rather than silently switching to another provider; otherwise you would receive another model's output under the model name you requested, with nothing anywhere saying so.

Changes to the catch-all route take effect within a minute, because already-resolved models have a short cache.

Platform model switch

This group of settings has one switch, enablePlatformModels (shown in the console as Scope → Use platform models). For the default Router, change it with PUT /v1/routing/settings; for a named Router, use PUT /v1/routers/{id} (the same field name). A newly created Router is on by default.

When on:

  • Platform shared models are available.
  • Your own same-named route takes priority, and the platform route can serve as a fallback behind it.

When off:

  • Every key bound to this Router can no longer see platform models. For the default Router, that means all child keys under the account that have not been individually bound to another Router.
  • GET /v1/models no longer returns platform models.
  • These keys can only use the routes you have configured yourself.

For these keys, it takes effect from their next call; calls already sent are not retracted.

The read endpoint for this group of settings is GET /v1/routing.

Allow models with no route

Scope also has Allow models with no route.

When on, model names with no explicit route can be forwarded as-is to the Passthrough channel you designate.

When off, models with no route return 404.

This is very similar to the * catch-all route, but it appears in the console as a Router-level setting. Note: it depends on a specific passthrough channel, and takes effect within a minute after you toggle it.

Routes for one key

Routes apply to all keys by default. To send one key somewhere else, pick it in the selector next to Routes (it reads All keys until you change it) (or use the route icon next to the key on API Keys), then add routes as usual.

  • A model the key has its own routes for runs only on those routes for that key. The routes all keys follow are not mixed in.
  • Every other model follows the routes all keys follow, and changes there apply to this key too.
  • Billing, Use platform models and Allow models with no route are account settings and stay the same for every key.
  • Removing the key's last route for a model puts that model back on the routes all keys follow.

Over the API, pass apiKeyId to GET /v1/routing (only that key's own routes come back in myRoutes), to POST /v1/routing/routes and to POST /v1/routing/routes/arrange. Editing or removing a route by id needs no apiKeyId. GET /v1/routing also returns keyOverrides: which keys have routes of their own and for which models.

A key bound to a named Router (below) cannot also have routes of its own; unbind it first.

A provisioning key can have routes too, the same way. They are for the child keys it issues: a child key with no routes of its own follows its master key's routes, and every model the master key has no routes for follows the routes all keys follow. Such a child key's routes are changed on its master key, not on the child key; GET /v1/routing?apiKeyId=<child key> says which master key it follows in inheritsFrom.

An account can have multiple Routers

By default, the Routing page edits the account's default Router. For the vast majority of accounts, that is all you need.

Look one level deeper: that default routing is really a Router, and an account can have more than one. Useful in advanced scenarios:

  • Test keys go through cheap models.
  • Production keys go only through stable providers.
  • A given customer is allowed to use only specified channels.
  • Different projects have different fallback strategies.
One account, more than one Router The default routes on the account are one Router. An account can have more. A key uses the Router it is bound to. An unbound key uses the default Router. One account, more than one Router Account What you edit on Routing is the account's one default route set Default Router The account's one default set Named Router Several, each with its own routes Keys with no binding They land here Keys bound to it They use its route set Bind a key to a Router: POST /v1/api-keys/bind-router Test keys can use cheap models. Production keys stay on vendors you trust.
An account can have multiple Routers

Related endpoints:

OperationEndpoint
List / create RoutersGET / POST /v1/routers
Modify / delete a RouterPUT / DELETE /v1/routers/{id}
Bind an API key to a RouterPOST /v1/api-keys/bind-router
List routes of a named RouterGET / POST /v1/routers/{id}/routes
Modify / delete a named Router's routePUT / DELETE /v1/routers/{id}/routes/{routeId}

A named Router also has its own full set of routes, with priority, weight, and catch-all rules exactly the same as the default Router. Testing and smart arrangement work the same way too: POST /v1/routers/{id}/routes/{routeId}/test and POST /v1/routers/{id}/routes/arrange.

A key with no Router bound uses the account's default Router.

Caller-specified backup models for one request: models

Everything above is configured once on the Routing page and applies to all calls. models is the same idea, but handed to the caller, and applies only to this one call.

Code / Terminal
{
  "model": "GLM 5.1",
  "models": ["GPT-5.6 Sol", "Claude Opus 5"],
  "messages": []
}

Execution order:

  1. model is still required, and is always tried first. It carries all of its configured routes, priority, weight, and catch-all route, exactly as if there were no models.
  2. Only after all routes for model are exhausted (not configured at all, or configured but all candidates have tripped the circuit breaker / failed) does it fall back to models[0].
  3. If that still fails, it tries models[1].

At most 5 backup models; anything beyond that is silently dropped, with no error.

The model field in the response and the price you are charged both reflect the model that actually answered. If the call ends up on "Claude Opus 5", that is what the response says, not the one you wrote first.

models is consumed by Tare itself and is never forwarded upstream. It shares a name with a field OpenRouter recognizes; forwarded as-is, OpenRouter would take model names that mean nothing to it and run its own failover logic.

Caller-specified channel preferences for one request: provider

You can pass provider in a request to adjust the candidate channels for just this one call, without editing the Routing page.

Code / Terminal
{
  "model": "GLM 5.1",
  "provider": {
    "order": ["openrouter"],
    "only": ["openrouter", "our-own-channel"],
    "allow_fallbacks": false,
    "sort": "latency"
  },
  "messages": []
}
FieldEffect
orderTries these channel names first, in this order; unless allow_fallbacks is turned off, the remaining resolved candidates follow behind
onlyAn allowlist; all other channels are removed from the candidate list
ignoreA blocklist; removes these channels
allow_fallbacksDefaults to true. When set to false, only channels named by order/only are allowed; if none of them can be reached, the call fails outright and no others are tried
sort"latency" reorders by measured average latency, fastest to slowest, using the same data that default route ordering already uses

Channel name matching is case-insensitive and compares against the name shown on the Channels and Routing pages.

If only/ignore/order filter the candidates down to none, the response is 400, not 404. This distinguishes "your preferences excluded all candidates" from "this model has no route". The error message lists which channels this model actually has configured, so you can check whether a name was misspelled.

sort: "price" and sort: "throughput" are accepted but currently have no effect. Many OpenRouter-compatible clients send these two values by default; rejecting calls because they are unsupported would drag down a batch of requests that have nothing to do with this field. price also genuinely has no meaning right now: platform pricing is set per model, not per channel, so different channels for the same model have the same price, and there is no price to sort by.

Like models, the provider object is consumed by Tare and does not reach your upstream.

How much time a failover takes

When a call actually failed over between channels, GET /v1/generation (see Endpoints) reports latency and generation_time separately:

  • generation_time is the time taken by the provider that actually answered.
  • latency adds to that the time taken by each failed attempt before the failover.

The difference between the two, routing_overhead_ms, appears only when a failover actually happened, so you can tell "this model is just slow" from "the request first hit a dead channel" without digging into call details.

Multimodal

A route can declare which input types its channels accept; requests with images are sent only to routes that declare they accept images.

Routes that do not declare anything are not excluded. "Undeclared" is treated as "unknown, do not exclude"; otherwise, the moment this field is enabled, all image requests would lose all their candidates at once.

This cannot be self-configured yet: the route-editing endpoint does not have an input type field. If a route needs to declare this, contact us.

Local Nodes and routing

Channels on a customer Local Node follow the same rules: Priority sets the order, and within a tier sessions are spread across channels by Weight. Success and failure the node reports update channel health.

If the node is down, a call that connects to the node directly fails. Tare's servers do not send it for you. To stay on the server path, leave the channel unmarked as LOCAL_NODE.

If you do not want to run your own, use the official node at https://tare-node.jamerly.ai. It is not in your network. See Local Nodes.

SOP: Add a stable route

  1. On the Channels page, confirm the channel has been added.
  2. Run Test and Chat on the channel.
  3. In Cost prices, confirm the target upstream model exists, or confirm the upstream will report the real cost in its response.
  4. Open Routing.
  5. Fill in the public Model name.
  6. Select the Channel.
  7. Select or enter the Upstream name.
  8. Set the first route to Primary and leave weight at 1.
  9. Set the second and later backup routes to Fallback.
  10. Run the test on each route.
  11. Send a real request with a business key.
  12. In Call Traces or a generation query, confirm the model, channel, latency, and cost actually hit.

Minimum acceptance checklist

  • Every public model name has the route you expect.
  • The naming boundary between Model and Upstream name is clear.
  • The Primary / Fallback order matches what the business expects.
  • The Weight ratio within a tier matches expectations.
  • Routes you want to pause use the off switch, not weight set to 0.
  • The catch-all route or passthrough setting is explicitly on/off.
  • The platform model switch matches the current Router's business scope.
  • Route tests pass.
  • The model returned by real calls and the channel hit match expectations.

Next steps

These three articles form one chain, read in order: connect a channel → record cost prices → configure routing. You have now finished the third step.

  • Previous step: if you have not recorded cost prices yet, read Cost prices.
  • The step before that: if you have not connected a channel yet, read Channels.
  • To have BYOK call the upstream directly from your own network: read Local Nodes.
  • To see which route each call actually hit: read Call Traces.
  • If you run into a word you do not know: check the Glossary.
Docs last updated Nov 27, 2026, 12:56 (UTC+8)