Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Monitoring, Ops & Incidents

Monitoring, Ops & Incidents

Route LLM tasks to the cheapest capable Claude models with Anthropic

When an API call/webhook arrives, it monitors systems with Claude.

What it does

## Cheapest Capable LLM Router ### How it works A task comes in by webhook. A cheap classifier model (Haiku) scores its complexity, risk and needs (reasoning, code, web search, long context). The router then picks the cheapest model in the catalog that is capable enough, builds an escalation chain of higher tiers, and runs the task. A cheap judge scores the answer; if it falls below the quality threshold the task escalates to the next tier with the judge's feedback. The response includes the answer, routing trace, actual cost and savings versus always using the premium model. ### Setup steps - Create an HTTP Header Auth credential for Anthropic (header x-api-key) and select it on the three Claude HTTP nodes: Classify Task, Execute Model, Judge Quality. - Edit Set Router Configuration: model catalog (tiers, prices per 1M tokens, context windows - verify against current pricing), quality threshold, max attempts, premium baseline model. - Optional: set ledgerUrl to the Execution Ledger webhook (/webhook/agent-ledger-event) to log every call and its cost. - POST to /webhook/llm-router with { "task": "...", "context": "...", "maxCostUsd": 0.05, "minTier": 1, "forceModel": "", "minQualityScore": 7, "maxAttempts": 3 }. Only task is required. A manual run uses a sample task. ### Customization - Add a model: add a row to the catalog JSON (id, tier 1-3, prices, contextWindow, webSearch). - Change how complexity maps to tiers in the Select Cheapest Capable Model node. - Set judgeEnabled to false to skip quality checks and never escalate on score.

The steps

  1. When Task Submitted
  2. When Manual Test Run Initiates
  3. Normalize Task Input
  4. If Task Is Valid
  5. Respond with Validation Error
  6. Set Router Configuration
  7. Build Classifier Request
  8. Classify Task
  9. Select Cheapest Capable Model
  10. Build Execution Request
  11. Execute Model
  12. Record Attempt
  13. Route Next Action
  14. Build Judge Request

21 steps in total.

Similar automations