Speed
Routes to the model with the lowest measured time-to-first-token for this prompt shape and region, within your quality floor.
Most requests do not need your most expensive model. Smart routing scores each request and sends it to the cheapest model that clears your quality bar — inside the latency and cost budget you set.
Routing is per request, not per application. The same service can optimise for cost on background jobs and for latency on the interactive path.
Routes to the model with the lowest measured time-to-first-token for this prompt shape and region, within your quality floor.
Finds the cheapest model that has historically passed your evaluation set on requests like this one, and stops at your per-request ceiling.
Sends the request to the strongest available model, with cheaper models used only as fallbacks when the primary is degraded.
routing block.
min_quality, support the requested features, and are healthy in your region.
max_cost_usd.max_latency_ms.response = client.reason(
model="auto",
input=prompt,
routing={
"optimize": "cost", # cost | speed | quality
"max_cost_usd": 0.02, # hard ceiling per request
"max_latency_ms": 1500, # budget for first token
"min_quality": "frontier-sm", # never route below this tier
"fallback": ["frontier-lg", "oss-70b-instruct"],
},
)
print(response.route.selected) # oss-70b-instruct
print(response.route.reason) # "met quality bar at 22% of cost"
Nothing is a black box. Every response carries route.selected,
route.reason, and the full attempt list, so a routing decision is always
explainable after the fact.
Figures below are from a representative production workload of 1M requests: support triage, summarisation, and extraction, mixed with a long tail of harder reasoning calls.
lower is better
lower is better
Baseline sends every request to a single frontier model. Routed applies optimize: "cost" with a quality floor. Quality was held flat against the same evaluation set in both runs.
Mirror a percentage of live requests to a candidate model, compare outputs offline, and promote only when the numbers hold.
Re-run any traced request against a different route to see exactly what would have changed, without touching production.
Pin a route for a customer, a project, or a single endpoint. Pins survive model deprecations and are reported before they expire.
Turn routing on with one field. Turn it off the same way.