Skip to main content
Dari Router gives your application one OpenAI-compatible endpoint that can choose the best configured model for each request. You create a router, enable the models it may use, choose managed or user-supplied provider keys for those models, and send requests with model: "dari/routing". The response uses the standard chat completions shape and includes a dari_routing object that shows which model was selected and why.
curl https://routing.dari.dev/rtr_123/chat/completions \
  -H "Authorization: Bearer $DARI_ROUTING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dari/routing",
    "messages": [
      {"role": "user", "content": "Write a concise incident summary."}
    ]
  }'

How It Works

  1. Create A Router and choose the models it can serve.
  2. Import Evals when you want benchmark scorecards to inform model selection.
  3. Choose Provider Key Sources for the providers represented by those models. Use Dari-managed keys or bring your own provider keys.
  4. Create A Routing API Key with the routing scope.
  5. Send Chat Completions to https://routing.dari.dev/{router_id}/chat/completions with model: "dari/routing".
  6. Read The Routing Result from dari_routing.selected_model in the response.

Core Concepts

Router

An organization-scoped endpoint with a stable rtr_... ID and a configured model set.

Enabled Models

The candidate models the router is allowed to choose from.

Provider Keys

Managed or encrypted BYOK OpenAI, Anthropic, and OpenRouter keys used after a model is selected.

Imported Evals

Structured benchmark scorecards the router can use as model-selection evidence.

Routing Instructions

Per-request guidance that helps the router choose between enabled models.

Compatibility

Dari Router accepts OpenAI-style chat completion requests, including non-streaming responses, streaming responses, tool definitions, tool choice, temperature, token limits, stop sequences, metadata, and response formats. See Send Chat Completions, Stream Responses, and Use Tool Calls.