Task Routing

Automatic intelligent model selection based on prompt complexity. Route simple tasks to cheap models and complex tasks to capable ones.

Task Routing

Task routing automatically classifies your prompts and routes them to the cheapest model capable of handling the task. Simple questions go to fast, cheap models; complex reasoning goes to frontier models.

How it works

  1. Classification - A lightweight classifier model analyzes the user's prompt to determine its complexity class
  2. Model selection - Cynos picks the cheapest model from a ranked pool that matches the complexity class
  3. Budget-aware - If you specify a model, routing only moves you to a cheaper alternative. You're never upsold
  4. Fallback chain - Your original model becomes the first fallback if the routed model fails

Enabling task routing

Per-request via header

Use the x-cy-eh-task-route header:

curl https://api.cynos.averlon.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-cy-your-api-key" \
  -H "Content-Type: application/json" \
  -H "x-cy-eh-task-route: on" \
  -d '{
    "messages": [
      {"role": "user", "content": "What is 2+2?"}
    ]
  }'

Without specifying a model

When you omit the model field entirely, the task router owns the choice and picks from the ranked pool outright:

curl https://api.cynos.averlon.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-cy-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "user", "content": "Summarize this document in three bullet points"}
    ]
  }'

Skipping task routing

Force task routing off for a specific request:

curl https://api.cynos.averlon.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-cy-your-api-key" \
  -H "Content-Type: application/json" \
  -H "x-cy-eh-task-route: off" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [
      {"role": "user", "content": "Complex analysis here..."}
    ]
  }'

Routing behavior

ScenarioWhat happens
No model specified, routing onRouter picks the cheapest ranked model for the task class
Model specified, routing onRouter only moves to a cheaper model; your model becomes first fallback
Model specified, routing offYour model is used directly
Router can't classifyFalls back to the configured default route or your specified model

Response metadata

Routed requests include routing information in the response's extra_fields:

{
  "extra_fields": {
    "task_route": {
      "outcome": "routed",
      "task_class": "simple_qa",
      "original_model": "openai/gpt-4o",
      "routed_model": "openai/gpt-4o-mini"
    }
  }
}

Possible outcomes:

  • routed - Request was redirected to a cheaper model
  • caller_route - Caller's model was kept (nothing cheaper available)
  • default_route - Configured default model was used
  • skipped - Routing did not run

Cost savings

Task routing is most effective when your traffic is a mix of simple and complex requests. Typical savings:

  • Simple Q&A, translations, formatting → routed to small/fast models (90%+ cost reduction)
  • Code generation, analysis, reasoning → kept on frontier models
  • Ambiguous tasks → classified conservatively, erring toward capability

Did this page help you?