PathFinder

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 typeDescriptionExample prompts
codingCode generation, debugging, review"Write a React component", "Fix this SQL query"
mathMathematical problems and proofs"Solve this integral", "Prove that..."
reasoningLogic, analysis, multi-step thinking"Compare these approaches", "What are the implications"
writingCreative and professional writing"Write a blog post", "Draft an email"
qaFactual questions and knowledge retrieval"What is the capital of...", "Explain DNS"
instructionFormatting, 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

  1. Your request is classified into a task type
  2. Models are filtered by hard constraints (eu, us)
  3. Remaining models are sorted by the chosen metric (quality by default, or cheapest, fastest, etc.)
  4. 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": "..." }] }'
FilterTypeBehaviorPlans
cheapestSortRank by cost per token (30% input / 70% output weighting)All
fastestSortRank by average latency (no-data models sort last)All
qualitySortRank by benchmark score (requires confidence ≥ 0.7)Builder+
ecoSortRank by provider eco score (greener first)Builder+
euHardExclude models without EU data residencyBuilder+
usHardExclude models without US data residencyBuilder+

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.