createAutoRouter() is a hosted routing policy. It sends the eligible candidate list and normalized conversation to Dari, receives a decision, and returns it to your local createRouter. Your executors still make provider calls and your provider credentials stay in your application.
You need a Dari API key with billing enabled. Auto Router selection is billed per selection call. For fully hosted routing and execution, use the Managed Router.
Setup
createAutoRouter does not accept a custom selector, selector runtime, selector model, or custom-rule strategy; those belong to createDariRoutingPolicy under /policy-engine.
What leaves your process
The selection request contains the conversation and eligible candidates. It does not contain provider credentials, request metadata, user identity, or encrypted reasoning continuations. Images are represented by an omission placeholder. Readable message content, tool arguments/results, and readable reasoning may be sent to Dari for selection. Review this data flow before enabling it for sensitive traffic.Selection leases
A policy may returnleaseTurnsRemaining. When a request has a cacheKey (OpenAI prompt_cache_key), createRouter stores that lease and serves the same eligible model on subsequent turns without calling the policy. The default store is in memory with a 30-minute TTL. Use a persistent leaseStore across replicas.
router.evaluatePolicy() never reads or writes leases. router.select() and router.fetch() do.
Configuration
createDariRoutingPolicy, you must provide both yourself. The endpoint client posts to /select and accepts an endpoint that already ends in /select.
Choosing an approach
Use Auto Router when you want hosted selection but local execution. Use a localRoutingPolicy when a deterministic rule is enough or the conversation cannot leave your system. Use createDariRoutingPolicy when you want the advanced self-hosted selector pipeline. Use the Managed Router when Dari should host the full service.