80trust / 100

Model Route

by model-route in AI models & inference

x402 APIPassing, checked 17 min ago

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.

GET https://api.agentstools.dev/model/route

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
91 ms typical, 125 ms slowest 5%
Last check
17 min ago
Next check
in 14 min

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://api.agentstools.dev/model/route?max_output_price=10&min_context=200000&needs_tools=true&task=coding"
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.agentstools.dev%2Fmodel%2Froute
const res = await pay("https://api.agentstools.dev/model/route?max_output_price=10&min_context=200000&needs_tools=true&task=coding");
console.log(await res.json());

Example input

{
  "max_output_price": 10,
  "min_context": 200000,
  "needs_tools": true,
  "task": "coding"
}

Example output

{
  "attribution": [
    "LiteLLM (BerriAI) — MIT",
    "models.dev — MIT",
    "Aider — Apache-2.0"
  ],
  "candidate_count": 41,
  "rationale": "Cheapest of 41 models passing [context >= 200,000; tool-use] for task 'coding'.",
  "recommended": {
    "benchmark": {
      "pass_rate": 32.4,
      "source": "aider_polyglot"
    },
    "blended": 1.3,
    "caps": [
      "tools",
      "vision"
    ],
    "citations": [
      {
        "license": "MIT",
        "source": "litellm",
        "source_url": "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"
      }
    ],
    "context": 1047576,
    "id": "gpt-4.1-mini",
    "price_in": 0.4,
    "price_out": 1.6,
    "provider": "openai"
  },
  "sources_used": [
    "litellm",
    "modelsdev",
    "aider_polyglot",
    "aider_edit"
  ],
  "task": "coding"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
17 min agoPassed40231 ms$0.02
4 h agoPassed402100 ms$0.02
7 h agoPassed40291 ms$0.02
11 h agoPassed402125 ms$0.02
15 h agoPassed40291 ms$0.02
18 h agoPassed40234 ms$0.02
22 h agoPassed40289 ms$0.02
26 h agoPassed40223 ms$0.02
29 h agoPassed40295 ms$0.02
34 h agoPassed402196 ms$0.02