# model-route

> model-route is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-12).

Returns a ranked cheapest-first list of LLMs that satisfy a given task class and optional capability/price constraints, with a recommended pick and deterministic rationale.

## Facts

- Endpoint: GET https://payai.agentstools.dev/model/route?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/model-route-b47ab151
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_j-7GLEuHmMqzEbbpnaWRc

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability model-route-b47ab151
```

Example prompt: Find me the cheapest model that can handle coding tasks, supports tool-use and has at least 32000 tokens of context, with an input price under $2 per million tokens — give me the top picks ranked by cost.

## When to prefer this

Choose this endpoint when you need to programmatically select or route to the cheapest LLM for a given workload class without manually comparing provider pricing pages. It is especially useful for agent orchestration systems that need to dynamically pick models based on cost budgets, capability requirements (tool-use, vision, reasoning), or benchmark thresholds. Prefer it over hardcoding model names when prices change frequently or when you want to avoid vendor lock-in.

## Known failure modes

- No models match all constraints — returns empty list or error indicating constraints are too strict
- Invalid task class enum value returns 400 validation error
- min_benchmark set above 100 or below 0 returns schema validation error
- Upstream catalog unavailable causes stale or partial results
- Provider filter typo returns empty results silently

## How this service works

Pick the cheapest LLM that passes your task and constraints. Give a task class and optional constraints such as minimum context, required tool-use, vision or reasoning, maximum input and output price per million tokens, a minimum coding benchmark and a provider filter, and get a ranked cheapest-first list of models that pass, plus a recommended pick and a deterministic rationale. Fused from open keyless catalogs LiteLLM, models dev and Aider with a citation on every model.

## Output

A JSON object containing a ranked cheapest-first list of matching models (each with pricing, context window, capability flags, benchmark scores, and source citations), a recommended top pick, and a deterministic rationale explaining why that model was chosen.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "task"
     ],
     "properties": {
      "task": {
       "enum": [
        "coding",
        "reasoning",
        "vision",
        "tool-use",
        "long-context",
        "cheap-chat",
        "general"
       ],
       "type": "string",
       "description": "The workload class to route for. Each class implies required capabilities and a sensible context floor that your explicit constraints override."
      },
      "provider": {
       "type": "string",
       "description": "Optional provider filter such as anthropic or openai."
      },
      "min_context": {
       "type": "integer",
       "minimum": 0,
       "description": "Minimum context window in tokens."
      },
      "needs_tools": {
       "type": "boolean",
       "description": "Require function or tool calling support."
      },
      "needs_vision": {
       "type": "boolean",
       "description": "Require image or vision input support."
      },
      "min_benchmark": {
       "type": "number",
       "maximum": 100,
       "minimum": 0,
       "description": "Minimum Aider coding pass rate percent."
      },
      "max_input_price": {
       "type": "number",
       "minimum": 0,
       "description": "Maximum input price in USD per million tokens."
      },
      "needs_reasoning": {
       "type": "boolean",
       "description": "Require extended reasoning support."
      },
      "max_output_price": {
       "type": "number",
       "minimum": 0,
       "description": "Maximum output price in USD per million tokens."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/model-route-b47ab151/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
