Pareto Router

Pick a coding model by minimum coding score without choosing a specific model

The Pareto Router (openrouter/pareto-code) is a way to have OpenRouter always pick a strong coding model for your needs without committing to a specific one. You express a single min_coding_score preference between 0 and 1, and the router routes your request to a coding model that meets that bar.

Overview

The Pareto Router is tuned for coding use cases. It maintains a curated shortlist of strong coding models currently available on OpenRouter, ranked by their Artificial Analysis coding percentile (an integer between 0 and 100 that captures how a model ranks within AA’s benchmarked coding field). Your min_coding_score picks the tier of models you want to route to. Within the chosen tier the router selects the cheapest model that is currently available (or the fastest, when you request the :nitro variant).

The name comes from Pareto efficiency: the goal is to give you a strong coder without overspending. The exact shortlist evolves over time as new models land and benchmarks shift.

Usage

Set your model to openrouter/pareto-code and optionally pass the pareto-router plugin to control the minimum coding score:

1import { OpenRouter } from '@openrouter/sdk';
2
3const openRouter = new OpenRouter({
4 apiKey: '<OPENROUTER_API_KEY>',
5});
6
7const completion = await openRouter.chat.send({
8 model: 'openrouter/pareto-code',
9 plugins: [
10 {
11 id: 'pareto-router',
12 min_coding_score: 0.8,
13 },
14 ],
15 messages: [
16 {
17 role: 'user',
18 content: 'Write a Python function that merges two sorted lists.',
19 },
20 ],
21});
22
23console.log(completion.choices[0].message.content);
24console.log('Model used:', completion.model);

The min_coding_score parameter

min_coding_score is an optional number between 0 and 1, where 1 is best. The router maps it to one of three quality tiers, and each tier corresponds to a percentile band on Artificial Analysis coding scores.

min_coding_scoreTierAA coding percentile band
>= 0.66hightop of AA’s coding field
>= 0.33, < 0.66mediumstrong modern flagships below the top
< 0.33lowcapable coders that still beat AA’s median
omittedhigh (default)top of AA’s coding field

If you omit min_coding_score, the router defaults to the strongest available coders. Within a tier, the router picks the cheapest available model, or the fastest by p50 throughput when you request the :nitro variant.

The router resolves a primary coding model plus up to two same-tier fallbacks. The primary is what serves your request. The fallbacks only fire on transient provider errors or rate limits, they do not load-balance traffic. If the entire tier has no models currently published on OpenRouter, the router steps into a neighboring tier instead. The response model field always reports the concrete model that handled the request.

Because the scoring axis is a percentile within AA’s benchmarked coding field, the capability bar implied by a given min_coding_score shifts as the frontier moves. A new strong release can push existing models down a percentile band, so min_coding_score=0.66 always means “top of the current field” rather than “above an absolute capability score”.

Response

The response includes the model field showing which coding model was actually used:

1{
2 "id": "gen-...",
3 "model": "anthropic/claude-opus-4.7",
4 "choices": [
5 {
6 "message": {
7 "role": "assistant",
8 "content": "..."
9 }
10 }
11 ],
12 "usage": {
13 "prompt_tokens": 42,
14 "completion_tokens": 128,
15 "total_tokens": 170
16 }
17}

How It Works

  1. Tier resolution: Your min_coding_score value is mapped to one of three tiers (high, medium, low) using the thresholds in the table above.
  2. Candidate filtering: The router takes the tier’s curated shortlist and filters it to models that are currently published on OpenRouter.
  3. Selection: The filtered shortlist is sorted by price ascending, or by p50 throughput descending when you request the :nitro variant. The top entry becomes the primary model and the next two are kept as same-tier fallbacks.
  4. Runtime fallback: If the primary’s endpoints are unavailable due to transient provider errors or rate limits, the request cascades through the same-tier fallbacks. Only when the entire tier is missing from the catalog does the router step into a neighboring tier.
  5. Request forwarding: Your request is forwarded to the selected model.

Pricing

The Pareto Router itself adds no fee. You pay only for the underlying model that handles the request. Because model selection varies across the shortlist, per-request cost will vary too. Use a lower min_coding_score when cost is the primary concern.

Limitations

  • Coding only: openrouter/pareto-code is tuned for coding tasks. For other use cases, use a different router or choose a specific model.
  • Model selection may change over time: For a given min_coding_score, the same model is selected deterministically (sorted by price). However, the selected model may change when the underlying shortlist is updated (e.g. new models are added, benchmarks shift, or the percentile bands rebucket as the AA field evolves). Within a conversation, provider sticky routing keeps your requests on the same provider endpoint to maximize cache hits.
  • Coding score only: min_coding_score is the only router parameter. You can’t directly cap cost or latency per request.