Skip to main content

Routing with Artemis

Routing means deciding which AI model answers your request. This page explains how NuRoute decides, and what you can do about it.

Every request is answered by one model. NuRoute either sends it to the model you name, or lets Artemis, its model picker, choose one for this prompt. Nothing is blended, and choosing adds no extra AI call.

  • You send model: "auto" or an Artemis option. Artemis picks the model for this prompt, then the provider (the company that runs the model). If Artemis cannot decide, a simpler fallback router decides instead, and the response tells you why (see below).
  • You name a model (for example model: "gpt-5.5"). Nothing is picked. NuRoute chooses a healthy provider for that model, but only if your organization may use it. Named models are off by default: a model NuRoute has not enabled for your organization is refused with 403 (policy_violation) before anything is sent or billed. The message says to use an Artemis model instead. Your admin can enable specific models or providers for the organization in the Backoffice. Artemis (auto and the artemis-* options) is always available.
const res = await client.chat.complete({
model: 'auto',
messages: [{ role: 'user', content: 'Summarize this in one line: ...' }],
});
res.model; // the model that served it

Want proof that Artemis chooses well? See the Benchmarks.

Artemis options​

An option is your choice between cheaper and better. Send it as the model.

Cost, Balanced and Quality options

modelOptionHow it picksQuality target
artemis-costCostThe best expected score after a heavy penalty for extra cost92%
artemis-balancedBalancedThe best expected score after a moderate penalty for extra cost. What auto means97%
artemis-qualityQualityThe best expected score; extra cost counts for little99%
  • auto is Balanced (while your organization has Balanced on; if it is off, auto uses the first option that is on, cheapest first). "auto-artemis-task", "auto-v2" and "nuroute/artemis" mean the same as "auto" and still work.
  • Which options you may use is set for each organization. On NuRoute Cloud, Cost and Balanced are on, and Quality is available on request. If you use an option your organization may not use, you get 400 invalid_request_error that names the ones you may use. GET /v1/artemis-options lists yours.
  • The price is the same for every option: Artemis's per-token rate, whichever model it picks.

What is "the penalty for extra cost"? Artemis gives each model an expected score for your prompt. Then each option takes some points away from a model that is expected to cost more than the cheapest choice for the same request. The more extra it costs, the more points it loses. The only difference between the options is how many points they take away.

What is "the quality target"? NuRoute tuned each option on its own training data so that it keeps at least that share (92%, 97% or 99%) of the quality of the best single model in the pool on those prompts. It is not a promise for your own traffic.

How Artemis decides​

Five steps: read the request, score each model, price each answer, apply your option, pick a provider

For every model in its pool, Artemis estimates two things: how well the model would answer this prompt, and what the answer would cost. Then it picks using your option.

  1. Read the request. A small text encoder (a program that has learned to read prompts, but does not write answers) looks at the request. It returns the prompt's mix of task types: a weight for each of 24 types, such as extraction, summarising, coding, translation or reasoning.

  2. Expected score per model. For every model in the pool, the capability matrix says how well that model usually answers a prompt with that mix.

  3. Expected cost per model. A second small model predicts how long each model's answer will be. Artemis prices your prompt's tokens plus that answer at the catalogue price.

  4. Apply the option. The option turns the scores and costs into one choice.

  5. Pick the provider. Some providers are already out of the running:

    • those your region restrictions do not allow;
    • those that cannot serve the request (for example the context is too big, or you need tool calling);
    • those that are failing their health checks;
    • models their provider has stopped serving (checked every day).

    Among the providers left for the chosen model, the one with the lower latency (delay) wins. NuRoute uses the delay it has observed, or the catalogue's estimate if it has none yet.

Ties go to the cheaper model, then to the model id.

Artemis decides every auto request​

Artemis decides every auto and Artemis-option request. The fallback router decides only the requests Artemis cannot (below). You do not choose a router.

  • "auto-apollo-tier" and "auto-v1" used to pick the fallback router for one request. They are now refused with 400 invalid_request_error.
  • The x-nuroute-router header is not needed. artemis or v2 is accepted and changes nothing. Any other value is refused with 400 invalid_request_error.
  • GET /v1/models lists real models only. It does not list auto, the options or their synonyms.

The response's model is the model that served the request, in every streamed chunk too. Artemis chooses only among the models in its pool. To use another model from the catalogue, name it in model.

Self-hosted NuRoute does not include Artemis yet. There, the fallback router decides every auto request, at the option's trade-off. X-Router-Version is v1 and X-Router-Fallback is v2_disabled.

Conversation stickiness​

In a chat, every turn re-sends the whole conversation so far. Providers remember prompts they saw recently, and they charge much less for the part they already hold (the cached-input price). But that only works on the same model.

So Artemis can keep a conversation on the model that answered the last turn, when the saving from the cache is worth more than moving to another model. It weighs this like any other cost. It never overrides your region restrictions, your budget, or a model that cannot serve the request. Stickiness is being rolled out.

You do not have to change anything. NuRoute links the turns of a conversation from the history each request re-sends. It keeps only a keyed hash of the history (a scrambled fingerprint, never a copy), and the link to the previous turn expires 10 minutes after the last turn.

HeaderEffect
x-nuroute-sticky: offThis request is routed on its own, never kept on the previous turn's model. on (the default) allows it
x-nuroute-session: <id>Your own id for the conversation (1 to 128 letters, digits, ., _, : or -), when you would rather name it than have NuRoute link turns from the history. For example, when your client rewrites earlier messages. The tools, system prompt and first message stay part of it: changing them starts a new conversation, as the provider's cache would

Serving many people with one key? Send each person's id in the request's user field (as in OpenAI's API; up to 256 characters; hash it if it is personal data). NuRoute then keeps each person's conversations apart, so two people whose chats start the same way never share a model choice or a cache. The id is never stored.

Both headers apply to auto and Artemis-option requests only. Any other value is a 400.

The capability matrix​

The capability matrix is a table of what Artemis knows about each model in its pool. For each model and each of the 24 task types, it holds:

  • the expected score of that model's answers on prompts of that type, and
  • an uncertainty band (5% to 95%), which shows how sure the estimate is.

For a prompt that mixes task types, the same table gives the expected score for that mix. Artemis decides on the expected score.

These scores are measured, not copied from the companies' ads. Each pool model answers NuRoute's exam prompts, the answers are graded, and the grades are fitted for each task type.

Which router decided​

Every auto and Artemis-option response says which router decided it, streamed or not.

HeaderMeaning
X-Router-Versionv2 when Artemis decided, v1 when the fallback router did
X-Router-Capability-VersionArtemis only: the capability version it decided with, e.g. cap-2
X-Router-FallbackPresent when the fallback router decided instead of Artemis; the value is the reason
X-Router-ModelThe model served
X-Router-Estimated-SavingThe estimated share saved against always using NuRoute's large reference model, worked out from the served model's price
X-Router-Reasoning-EffortWhen you set reasoning_effort and the served model's levels are known: the level it got. Each model takes only some levels, so yours goes to the nearest one it takes
X-Router-Tier, X-Router-Confidence, X-Router-Tier-EscalatedOnly when the fallback router decided: the tier it predicted (0 small · 1 medium · 2 large), its probability for that tier, and the higher tier it served, if it served one

When a provider fails and the request is routed again, the headers describe the route that served the answer. On a streamed response the headers go out with the first write, so after a keep-alive (sent after 15 s with nothing else to send) they stay the first route's.

The request log has the same facts. GET /v1/requests/{id} and GET /v1/routing/history/{id} (client.requests.get(id), client.routing.getDecision(id)) return routerVersion, capabilityVersion and routerFallback, all three null for a request that named a model, plus the candidates Artemis weighed.

Request handling​

Your prompt text is redacted (private details are hidden) before it reaches Artemis, and Artemis makes no network calls of its own. No big language model sits in the routing path. Its two small models (the task-type reader and the answer-length model) run on every auto request.

Behaviour
StreamingSupported. The routing is settled before the stream opens, so a routing failure still returns a normal JSON error, not a half-written stream. Streamed responses carry the same X-Router-* headers as normal ones.
Multi-turnArtemis reads the system prompt and the latest user message only, so a short follow-up like "now in French" is judged on its own words. The whole conversation still counts towards the token estimate, and so the expected cost. The model is chosen per request, so a conversation can move between models, unless stickiness keeps it in place.
Tool callingSupported, with a provider-level check: a request that carries tools goes only to providers that declare function calling. The capability matrix does not measure how reliably a model calls tools, so for quality-sensitive tool traffic, naming a model is the safer choice.
Structured outputresponse_format is not supported yet. The field is ignored, and routing does not take it into account. To get JSON reliably today, name a model you know supports it and ask for JSON in the prompt.

When something fails​

NuRoute plans for things to go wrong. Here is what happens.

SituationWhat NuRoute does
Artemis cannot decide: no estimates in time (or no active capability version), an unknown capability version or invalid estimates, a request that pins a provider, no servable pool model, an error while deciding, or Artemis switched offThe fallback router decides the request, among the same models as Artemis's active capability version. The response carries X-Router-Fallback with the reason. If none of those models can serve it, you get 422 no_available_model.
Your region restrictions exclude every providerNuRoute applies your fallbackBehavior: fail (422 no_available_model), or relax to commercial, global or cheapest. The relaxation is recorded on the decision. A project's region restrictions are never relaxed: 422.
A provider rate-limits, times out, goes down, rejects credentials, or no longer knows the modelNuRoute leaves that provider out and decides again with the same estimates: the option's next-best (model, provider), up to three attempts. This applies to auto and Artemis-option requests only.
A request is malformed, or your policy rejects itYou see the error straight away. These would fail at every provider, so retrying would only waste time and hide the real error.
Every provider is rate-limitedYou get 429 instead of a request that hangs.

Good to know:

  • Cross-provider retry applies to non-streaming auto and Artemis-option requests. A streaming response that fails after the first token has already been sent is shown as a stream error. It is not silently sent elsewhere.
  • Retry is a way to recover from failure, not a load balancer. NuRoute reacts to a failure; it does not track each provider's rate-limit budget in advance.

Fallback (fallbackBehavior)​

fallbackBehavior is your choice for what happens when no provider passes your region restrictions. It runs before the model is chosen, and works the same whichever router decides.

It is not a "retry when a provider breaks" setting, and it is not the fallback router. Set it next to your regions: Settings → Regions in the dashboard.

ValueBehaviour
failRefuse the request if no eligible provider is found: 422, type no_available_model. Use this when a region rule must be a hard limit
allow_commercialFall back to any enabled commercial provider (default)
allow_globalFall back to any enabled provider anywhere
allow_cheapestFall back to the cheapest available provider

Routing history​

Every routed request creates a routing decision record. You can list them and see why a model and provider were chosen:

const { decisions } = await client.routing.listHistory({ limit: 10 });

const detail = await client.routing.getDecision(decisions[0].id);
// detail.selectedProvider, detail.selectedModel, detail.candidates,
// detail.routerVersion, detail.capabilityVersion, detail.routerFallback

On an Artemis decision, each candidate also carries quality (the model's expected score), utility, inputTokens, outputTokens and expectedLatencyMs.

See also​

  • Routing controls: the Artemis option, region restrictions, max tokens and budgets
  • Benchmarks: RouterArena's independent benchmark, and our enterprise test against single models and by industry
  • Projects: settings for each project, and project-scoped API keys