Skip to main content
The Model Router reads a task, classifies it with Neon 1.1, and ranks the models in its benchmark catalog for that task. You get one selected model, the classification that led to it, and a ranked shortlist with the expected quality, cost and latency of each candidate. Use it when your application sends prompts to several models and you want each prompt to go to the right one. The router selects a model; it does not call it. Send the prompt to the selected model with that model’s own client.

How a selection works

  1. Classify. Neon 1.1 reads the task and returns a probability for each of the 27 task types, a difficulty (trivial, standard, hard or expert) and facets such as expected output length, language, and whether the task needs tools or vision.
  2. Weigh. Each task type has a vector of benchmark weights. The router mixes the vectors of every task type at 5% probability or more, so a task that is part debugging and part code_review is judged on both.
  3. Filter. Your models filters, and max_latency_ms, remove models from the catalog. filters_applied reports how many models each filter removed.
  4. Rank. The policy turns expected quality, estimated cost and estimated latency into one score per model. The best score is model; the top ten are ranking.

Select a model

Send the task as prompt, or as messages (the same role and content turns as a run), never both.

Request fields

Unknown fields are refused with 400 invalid_body. The Idempotency-Key header is optional here. With one, a replay of the same body returns the stored selection with replayed: true and is not charged again. The same key with a different body is 409 idempotency_conflict, and a replay while the first classification is still running, or after it failed, is 409 classification_not_ready.

Policies

The quality bar applies to balanced and cost_efficient. threshold.q_star is the best expected quality among the filtered models, threshold.r is the share of it the task’s difficulty requires (0.55 for a trivial task up to 0.97 for an expert one, and at least 0.90 for a safety-sensitive task), and threshold.tau is q_star × r. A model below tau is not ranked, however cheap it is. To set your own trade-off, send weights with balanced:

Filter the catalog

models narrows the catalog before ranking. Every field is optional. When the filters remove every model the answer is 400 no_eligible_model. GET /v1/router/models lists the catalog with ids, providers, prices, context, modalities, speed and benchmark scores, so you can build filters from real values.

Read the response

Trimmed to the first candidate:
The values above show the shape of the response, not a real selection.

Cost

A selection is billed as one decision run on Neon 1.1: the same admission, credit, quota and settlement as POST /v1/runs with "kind": "decision", at the Neon 1.1 price in Models and pricing. It needs runs_write; GET /v1/router/task-types and GET /v1/router/models need runs_read and are free.

Long tasks

The router accepts long tasks: a request body of up to 4 MiB, which holds a task of 256k tokens or more. Neon 1.1 classifies the task from its head and tail, at most about 1,500 tokens, so a long task costs no more to classify than a short one and the selection finishes within the default 30-second decision deadline. input_tokens_est and every estimated_cost_usd and estimated_latency_ms still count the whole task, and min_context_tokens lets you require a context window large enough for it. Set your HTTP client timeout to at least 160 seconds, the same as for decision runs, so the server, not your client, ends a slow request. The official SDKs default to 170 seconds. A selection that runs out of time is 504 deadline_exceeded. When you then send a long task to Neon 1.1 as a decision run, its deadline grows with the input; see Limits.

Errors

  • Task types and policies - every task type the router classifies into, and the benchmarks behind each.
  • Decision runs - the run the router bills as, and how Neon 1.1 answers.
  • Idempotency - how replays work and when to mint a new key.
  • Limits - body size, input tokens and deadlines in one table.