SuperAgent Launching November 26. Early access opens toWaiting list
DigitSpace

Routing

Routing strategy

How DigitSpace ranks a model's providers by price, speed and health, how to set the strategy per project, and how to override it per request.

View as Markdown

A model is often served by more than one provider at different prices and speeds. The routing strategy decides the order they're tried in.

Strategy Dashboard name Ranks offers by
auto Balanced A mix of price and speed, half each by default. This is the default.
price Cheapest Lowest estimated cost for this request, then success rate, then speed.
latency Fastest response Lowest expected response time, then cost.

Whatever the strategy, healthy offers come first. An offer counts as healthy until it has at least 10 recent results and fewer than 90% of them succeeded.

Set it for a project

In the dashboard, open Routing and choose a Routing strategy. Owners, admins and the project's project admins can change it.

On the Enterprise plan, Custom settings on the same page also set:

  • Providers to try: how many offers a request may try, from 1 to 5 (3 by default).
  • Healthy threshold: the success rate an offer needs to count as healthy, from 50% to 99%.
  • Balance: the weight of cost against speed for the Balanced strategy.
  • Caller region: see Regions.

Override it per request

Send the X-DigitSpace-Routing header with price, latency or auto. Any other value is ignored and the project's setting applies.

curl https://api.digitspace.ai/v1/chat/completions \
  -H "Authorization: Bearer $DIGITSPACE_API_KEY" \
  -H "X-DigitSpace-Routing: latency" \
  -H "Content-Type: application/json" \
  -d '{ "model": "gpt-6-luna", "messages": [{ "role": "user", "content": "Hi" }] }'

How cost and speed are estimated

  • Cost is the offer's input price times the estimated input tokens, plus its output price times max_tokens (512 when not set).
  • Speed is the offer's median response time once it has 10 or more measured requests, otherwise 800 ms. Network distance between the caller's region and the provider's is added to it.

Checked against the gateway on 31 October 2026. Something wrong or missing? Tell us.