Skip to main content
Use routing.instructions to give request-specific guidance about how Dari Router should choose between the router’s enabled models. This is useful when the same router serves tasks with different cost, latency, or quality preferences. For stable benchmark evidence, import eval scorecards into the router instead of repeating scores in every request.

Example

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",
    "routing": {
      "instructions": "Prefer a low-latency model unless the request requires deep reasoning or complex code generation."
    },
    "messages": [
      {"role": "user", "content": "Find the bug in this distributed locking design."}
    ]
  }'

What To Include

Good routing instructions explain your tradeoff, not the exact model to pick. For example:
  • Prefer lower cost for short summarization tasks.
  • Prefer stronger reasoning for code review, architecture, and debugging.
  • Prefer lower latency for interactive user-facing replies.
  • Prefer the strongest model when correctness matters more than cost.
If you always want a fixed model, call that provider model directly instead of using a router.

Response Metadata

The response includes the selected model and reason:
{
  "dari_routing": {
    "requested_model": "dari/routing",
    "selected_model": "anthropic/claude-sonnet-4-6",
    "reason": "The request asks for architecture analysis and benefits from stronger reasoning."
  }
}