Routing & Filters
How PathFinder classifies tasks and how to control model selection with filters.
Task types
PathFinder automatically classifies each request into one of six task types using pattern matching on the conversation content.
| Task type | Description | Example prompts |
|---|---|---|
| coding | Code generation, debugging, review | "Write a React component", "Fix this SQL query" |
| math | Mathematical problems and proofs | "Solve this integral", "Prove that..." |
| reasoning | Logic, analysis, multi-step thinking | "Compare these approaches", "What are the implications" |
| writing | Creative and professional writing | "Write a blog post", "Draft an email" |
| qa | Factual questions and knowledge retrieval | "What is the capital of...", "Explain DNS" |
| instruction | Formatting, translation, structured output | "Translate to French", "Convert to JSON" |
Check X-Task-Type and X-Classification-Confidence in the response headers to see what was detected and how confident the classifier is.
How routing works
- Your request is classified into a task type
- Models are filtered by hard constraints (
eu,us) - Remaining models are sorted by the chosen metric (quality by default, or
cheapest,fastest, etc.) - The top model is selected, considering benchmark score and data confidence
Filters
Pass filters via the x-pathfinder-filters header to constrain or re-rank model selection.
curl https://api.pathfinder.dev/v1/chat \
-H "Authorization: Bearer pf_live_xxxxxxxxxxxxxxxx" \
-H "x-pathfinder-filters: cheapest,eu" \
-H "Content-Type: application/json" \
-d '{ "messages": [{ "role": "user", "content": "..." }] }'| Filter | Type | Behavior | Plans |
|---|---|---|---|
| cheapest | Sort | Rank by cost per token (30% input / 70% output weighting) | All |
| fastest | Sort | Rank by average latency (no-data models sort last) | All |
| quality | Sort | Rank by benchmark score (requires confidence ≥ 0.7) | Builder+ |
| eco | Sort | Rank by provider eco score (greener first) | Builder+ |
| eu | Hard | Exclude models without EU data residency | Builder+ |
| us | Hard | Exclude models without US data residency | Builder+ |
Hard filters eliminate models. Sort filters re-rank the remaining candidates. When no sort filter is specified, models are ranked by confidence-weighted benchmark score.
Default filters
You can set default filters on your API key so you don't need to pass the header on every request. Request-level filters are merged with key defaults. Configure this in Dashboard → API Keys → Settings.