From 6fad4de0439cf3ea27a8c01ce087724a9203c13d Mon Sep 17 00:00:00 2001 From: unknown <> Date: Wed, 24 Jun 2026 17:04:58 +0000 Subject: [PATCH 1/2] docs(openrouter-models): add intelligence and Design Arena ELO sort options The GET /models API now supports two new server-side sort values: - intelligence-high-to-low (Artificial Analysis intelligence index) - design-arena-elo-high-to-low (best Design Arena ELO across arenas) Updates: - list-models.ts: switch from client-side to server-side sorting via the sort query parameter, add intelligence and design-arena-elo flags - SKILL.md: document new sort options in decision tree, sort section, and API query parameters table - README.md: mention new sort options in feature list Source: OpenRouterTeam/openrouter-web#25600 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- skills/openrouter-models/README.md | 2 +- skills/openrouter-models/SKILL.md | 19 +++++++--- .../openrouter-models/scripts/list-models.ts | 35 ++++++++++++------- 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/skills/openrouter-models/README.md b/skills/openrouter-models/README.md index ea0e869..374781f 100644 --- a/skills/openrouter-models/README.md +++ b/skills/openrouter-models/README.md @@ -22,7 +22,7 @@ For other install methods (Claude Code plugin marketplace, Cursor Rules, etc.) s See [SKILL.md](SKILL.md) for the full reference, including: -- Listing and sorting models by newest, price, or throughput (`list-models.ts`) +- Listing and sorting models by newest, price, throughput, intelligence, or Design Arena ELO (`list-models.ts`) - Filtering by category (programming, roleplay, vision, etc.) - Looking up a specific model's pricing, context length, and modalities - Per-provider latency, uptime, and throughput via `get-endpoints.ts` diff --git a/skills/openrouter-models/SKILL.md b/skills/openrouter-models/SKILL.md index 31b9b85..742d74b 100644 --- a/skills/openrouter-models/SKILL.md +++ b/skills/openrouter-models/SKILL.md @@ -27,6 +27,8 @@ Pick the right script based on what the user is asking: | Find recently added models | `list-models.ts --sort newest` | "What are the newest models?" | | Find cheapest models | `list-models.ts --sort price` | "What's the cheapest model?" | | Find highest throughput models | `list-models.ts --sort throughput` | "Which models have the most output capacity?" | +| Find most intelligent models | `list-models.ts --sort intelligence` | "What are the smartest models?" | +| Find best design models | `list-models.ts --sort design-arena-elo` | "Best models for design/UI tasks?" | | Find models in a category | `list-models.ts --category X` | "Best programming models?" | | Search by name | `search-models.ts "query"` | "Do they have Claude?" | | Resolve an informal model name | `resolve-model.ts "query"` | "Use the nano banana 2.0 model" | @@ -77,12 +79,18 @@ Categories: `programming`, `roleplay`, `marketing`, `marketing/seo`, `technology ### Sort Results ```bash -cd /scripts && npx tsx list-models.ts --sort newest # Recently added first -cd /scripts && npx tsx list-models.ts --sort price # Cheapest first -cd /scripts && npx tsx list-models.ts --sort context # Largest context first -cd /scripts && npx tsx list-models.ts --sort throughput # Most output tokens first +cd /scripts && npx tsx list-models.ts --sort newest # Recently added first +cd /scripts && npx tsx list-models.ts --sort price # Cheapest first +cd /scripts && npx tsx list-models.ts --sort context # Largest context first +cd /scripts && npx tsx list-models.ts --sort throughput # Most output tokens first +cd /scripts && npx tsx list-models.ts --sort latency # Lowest latency first +cd /scripts && npx tsx list-models.ts --sort popular # Most popular first +cd /scripts && npx tsx list-models.ts --sort intelligence # Highest Artificial Analysis intelligence index first +cd /scripts && npx tsx list-models.ts --sort design-arena-elo # Highest Design Arena ELO first ``` +Sorting is performed server-side. Models without a score for benchmark-based sorts (intelligence, design-arena-elo) are placed last. + Models with upcoming `expiration_date` values trigger a stderr warning. ## Search Models @@ -136,6 +144,9 @@ Returns for each provider: |---|---|---| | `category` | `?category=programming` | Server-side category filter | | `supported_parameters` | `?supported_parameters=tools` | Only models supporting this parameter | +| `sort` | `?sort=intelligence-high-to-low` | Server-side sort order | + +Available `sort` values: `most-popular`, `newest`, `top-weekly`, `pricing-low-to-high`, `pricing-high-to-low`, `context-high-to-low`, `throughput-high-to-low`, `latency-low-to-high`, `intelligence-high-to-low`, `design-arena-elo-high-to-low`. Models without a score for the chosen benchmark are placed last. **Tips for working with the response:** diff --git a/skills/openrouter-models/scripts/list-models.ts b/skills/openrouter-models/scripts/list-models.ts index acb7efc..a67ecad 100644 --- a/skills/openrouter-models/scripts/list-models.ts +++ b/skills/openrouter-models/scripts/list-models.ts @@ -5,9 +5,25 @@ const args = parseArgs(process.argv.slice(2)); const category = args.get("category") as string | undefined; const sort = args.get("sort") as string | undefined; -const path = category - ? `/models?category=${encodeURIComponent(category)}` - : "/models"; +// Map user-friendly sort flags to the API's server-side sort parameter values +const SORT_MAP: Record = { + newest: "newest", + price: "pricing-low-to-high", + context: "context-high-to-low", + throughput: "throughput-high-to-low", + speed: "throughput-high-to-low", + latency: "latency-low-to-high", + popular: "most-popular", + intelligence: "intelligence-high-to-low", + "design-arena-elo": "design-arena-elo-high-to-low", +}; + +const params = new URLSearchParams(); +if (category) params.set("category", category); +const apiSort = sort ? SORT_MAP[sort] : undefined; +if (apiSort) params.set("sort", apiSort); + +const path = params.size > 0 ? `/models?${params}` : "/models"; const json = await fetchApi(path, apiKey); let models = (json.data ?? []).map(formatModel); @@ -20,16 +36,9 @@ if (expiring.length > 0) { ); } -if (sort === "newest") { - models.sort((a: any, b: any) => (b.created ?? 0) - (a.created ?? 0)); -} else if (sort === "price") { - models.sort((a: any, b: any) => parseFloat(a.pricing?.prompt ?? "0") - parseFloat(b.pricing?.prompt ?? "0")); -} else if (sort === "context") { - models.sort((a: any, b: any) => (b.context_length ?? 0) - (a.context_length ?? 0)); -} else if (sort === "throughput" || sort === "speed") { - models.sort((a: any, b: any) => - (b.top_provider?.max_completion_tokens ?? 0) - (a.top_provider?.max_completion_tokens ?? 0) - ); +if (sort && !apiSort) { + console.error(`Unknown sort option: "${sort}". Available: ${Object.keys(SORT_MAP).join(", ")}`); + process.exit(1); } console.log(JSON.stringify(models, null, 2)); From a079d86dbcdfa7a05e2700e7faeaf72001eb3fcb Mon Sep 17 00:00:00 2001 From: unknown <> Date: Wed, 24 Jun 2026 17:13:50 +0000 Subject: [PATCH 2/2] fix(openrouter-models): validate sort flag before API fetch Move unknown-sort guard before fetchApi to avoid a wasted round-trip on invalid flags. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- skills/openrouter-models/scripts/list-models.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/skills/openrouter-models/scripts/list-models.ts b/skills/openrouter-models/scripts/list-models.ts index a67ecad..2b78a5a 100644 --- a/skills/openrouter-models/scripts/list-models.ts +++ b/skills/openrouter-models/scripts/list-models.ts @@ -18,9 +18,14 @@ const SORT_MAP: Record = { "design-arena-elo": "design-arena-elo-high-to-low", }; +const apiSort = sort ? SORT_MAP[sort] : undefined; +if (sort && !apiSort) { + console.error(`Unknown sort option: "${sort}". Available: ${Object.keys(SORT_MAP).join(", ")}`); + process.exit(1); +} + const params = new URLSearchParams(); if (category) params.set("category", category); -const apiSort = sort ? SORT_MAP[sort] : undefined; if (apiSort) params.set("sort", apiSort); const path = params.size > 0 ? `/models?${params}` : "/models"; @@ -36,9 +41,4 @@ if (expiring.length > 0) { ); } -if (sort && !apiSort) { - console.error(`Unknown sort option: "${sort}". Available: ${Object.keys(SORT_MAP).join(", ")}`); - process.exit(1); -} - console.log(JSON.stringify(models, null, 2));