Routing
Routing is how NuRoute chooses which AI model and provider answer each request. client.routing lets you see and change how that works.
The short version: Artemis decides every model="auto" request, based on what each model is good at. A request that names a model uses no router. To learn how Artemis thinks, read How Artemis decides.
The router
There is no router for you to choose, neither per request nor in a setting.
- The chat call's
router=keyword (RouterChoice) is optional. It accepts only"artemis"or"v2", and both change nothing. Any other value raisesNuRouteErrorwithstatus400. - When Artemis cannot decide a request, the fallback router decides it. The request's
routerVersionandrouterFallbacksay so, and why (see Which router decided). - Your region restrictions apply either way.
More in Routing concepts.
Artemis options
An option is your choice between cheaper and better. Send it as the model: "artemis-cost", "artemis-balanced" or "artemis-quality". "auto" is "artemis-balanced". All three cost the same per token. They differ in how much extra cost is worth a better expected answer (Artemis options).
res = client.chat.complete(
model="artemis-cost",
messages=[{"role": "user", "content": "Extract the invoice number: ..."}],
)
res["model"] # the model Artemis picked
If your organization may not use an option, the request raises NuRouteError with status 400, and the message names the options it may use. On NuRoute Cloud, Quality is available on request. GET /v1/artemis-options lists yours.
Region restrictions
A region is a part of the world where a provider runs. Your organization's allowed regions and its fallbackBehavior live in the routing config.
update_config() replaces everythingIt replaces the whole config. So read it first, change only what you need, and send all of it back.
Changing the config needs an owner's or admin's session. Sign the client in with auth.login() (see Authentication). With an API key, get_config() works, but update_config() fails with 403.
config = client.routing.get_config()
config["allowedRegions"] = ["EU"]
config["policy"]["fallbackBehavior"] = "fail" # EU is a hard limit
client.routing.update_config(config)
- See Region restrictions for how regions match.
- See Fallback for what
fallbackBehaviorcontrols. It decides what happens when no provider is in your regions. It is not about whether the gateway retries when a provider errors.
Routing history
Look back at how recent requests were routed:
result = client.routing.list_history(limit=20, provider="openai")
decision = client.routing.get_decision(result["decisions"][0]["id"])
print(decision["selectedProvider"], decision.get("routerVersion"), decision["candidates"])
Which router decided
client.chat.complete() returns the response body only. So to find the router, read the request log. The completion id is chatcmpl- followed by the request id, and client.requests.list() can search for it:
res = client.chat.complete(model="auto", messages=messages)
request_id = res["id"].removeprefix("chatcmpl-")
page = client.requests.list(search=request_id, limit=1)
detail = client.requests.get(page["requests"][0]["id"])
print(detail.get("routerVersion"), detail.get("capabilityVersion"), detail.get("routerFallback"))
# v2 cap-6 None, or v1 None no_estimates when the fallback router decided
RequestDetail (from client.requests.get()) and RoutingDecision (from client.routing.get_decision()) both include the RouterDecision keys:
| Key | Type | Meaning |
|---|---|---|
routerVersion | RouterVersion | None | The router that decided: "v2" (Artemis) or "v1" (the fallback router). None for a request that named a model |
capabilityVersion | str | None | The capability version Artemis decided with, e.g. "cap-6". None when the fallback router decided |
routerFallback | str | None | Why the fallback router decided instead of Artemis. None otherwise |
RequestDetail also splits up the request's time:
| Key | Meaning |
|---|---|
latencyMs | The provider call |
routingDurationMs | Routing |
totalMs | End to end, as the gateway measured it (0 for requests recorded before it was tracked) |
overheadMs | The rest (None when totalMs is 0) |
There is no separate timeline call: requests.get_timeline() was removed, because the gateway has no such endpoint.
Why the fallback router decided
When the fallback router decides, the request is still served, and your region restrictions apply to its choice too. Here are the reasons:
routerFallback | Meaning |
|---|---|
estimate_busy | Artemis had no estimates: router-model was busy with other requests |
estimate_timeout | Artemis had no estimates: they did not arrive in time |
estimate_unavailable | Artemis had no estimates: router-model was unreachable or had no capability version loaded |
no_estimates | Artemis had no estimates for another reason (before 2026-10-23, for any of the reasons above too) |
unknown_capability_version | Artemis's estimates came from a capability version the deployment does not know |
manual_mode | The request pins a provider |
preset_unavailable | The capability version has no preset for the option |
no_servable_model | None of Artemis's models could be served after your region restrictions and the enabled providers |
v2_disabled | Artemis is switched off by the operator. Self-hosted NuRoute does not include Artemis yet, so its auto requests all report this |
invalid_estimates | Artemis's estimates failed a sanity check |
v2_error | Artemis hit an error while deciding |
Candidates
candidates lists what was weighed. Each one has provider, model, costUsd, latencyMs, score (0–100) and winner.
On an Artemis decision, each Candidate adds Artemis's own figures. There is one row for each pool model that can be served, on the provider that would serve it.
| Key | Type | Meaning |
|---|---|---|
quality | float | The model's expected score on this prompt (0–1) |
utility | float | The expected score minus the option's price for extra cost. The highest wins |
inputTokens | int | The prompt tokens it priced |
outputTokens | float | The answer length, in tokens, it expected |
expectedLatencyMs | float | The answer time it expected on this provider |
When the fallback router decided, candidates lists the models it weighed in its tier. score is each one's rank (the winner highest), and the keys above are absent.