Model routing

Send each prompt to the cheapest model that is enough — fast, balanced or frontier — and play safe when the tier is unclear, with the Model Routing template.

Goal: stop sending every prompt to your most expensive model. A cheap decision picks the tier; your code (or an LLM destination) calls that model.

Create the decision

Templates → Model routing → Create decision:

PartContent
Stateprompt (string, required)
tierchoice — fast, balanced, frontier, other; minimum confidence 0.6
complexityscore — trivial, simple, moderate, hard, very hard
Policiesnone; fallback action fallback
Destinationsfunction callModel with prompt and model = fast / balanced / frontier per tier; frontier_when_unsure on fallback

Call it

curl -X POST https://api.dcision.io/v1/decisions/model-routing \
  -H "Authorization: Bearer $DCISION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "state": { "prompt": "Translate '"'"'good morning, how are you?'"'"' to Spanish." } }'

The state's prompt is "Translate 'good morning, how are you?' to Spanish.".

200 OK (abridged)
{
  "schema": "model-routing",
  "result": { "tier": "fast", "complexity": "trivial" },
  "confidence": { "tier": 0.91, "complexity": 0.88 },
  "action": "continue",
  "destinations": [{ "key": "fast_model", "type": "function", "function": "callModel", "params": { "prompt": "Translate 'good morning, how are you?' to Spanish.", "model": "fast" } }]
}

Act on it

const MODELS = { fast: "openai/gpt-5-nano", balanced: "openai/gpt-5-mini", frontier: "anthropic/claude-opus-5-5" };
const call = decision.destinations.find((d) => d.function === "callModel");
return callModel(call.params.prompt, MODELS[call.params.model]);

Tune it

  • Let Dcision call the model: replace each function with an LLM destination on your OpenRouter or Vercel AI Gateway key — the answer comes back in the same response.
  • Describe your tiers in the option descriptions with examples from your own traffic.
  • Watch the Overview: if many prompts land in fallback, sharpen the options before raising the threshold.

On this page