# Route LLM tasks to the cheapest capable Claude models with Anthropic

> Quick Overview This workflow receives an LLM task via webhook (or manual run), uses Anthropic Claude to classify its needs, routes the request to the cheapest capable Claude model, and optionally escalates to higher tiers based on a quality score, returning the final answer with cost and routing details. How it works 1. Receives a POST request on the /webhook/llm-router endpoint (or runs manually) and normalizes inputs like task, context, budget, and minimum quality settings. 2. Rejects requests without a non-empty task and returns a 400 validation error to the caller. 3. Uses Anthropic Claude (Haiku) to classify the task’s complexity, risk, and requirements (for example code, reasoning, web search, long context), falling back to a built-in heuristic if classification fails. 4. Selects the cheapest model from a configurable Anthropic Claude catalog that meets the required tier, context window, web search capability, and optional max-cost constraints, and builds an escalation chain. 5. 

- **Domain**: `n8n-workflow-20258.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/20258
- Page (HTML): https://agenstry.com/agents/n8n-workflow-20258.n8n.io
- Documentation: https://n8n.io/workflows/20258
