npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openrouter-model-explorer

v1.1.0

Published

Dependency-light Node.js CLI for discovering and inspecting OpenRouter models.

Readme

openrouter-model-explorer

Dependency-light Node.js package for OpenRouter model discovery. It works both as a CLI and as an importable module, using built-in Node APIs instead of runtime helper libraries.

Install

npm install openrouter-model-explorer

For one-off CLI usage:

npx openrouter-model-explorer --help

For a global command:

npm install --global openrouter-model-explorer
openrouter --help

CLI usage

# cheapest tool-capable text models
openrouter models list --support tools --sort prompt-price --limit 10

# check whether specific search results are actually usable with the current token
OPENROUTER_API_KEY=sk-or-v1-... openrouter models list --search gpt-4o --check-access

# keep only models allowed by the token's provider/privacy policy
OPENROUTER_API_KEY=sk-or-v1-... openrouter models list --accessible-only --support tools

# privacy-aware models for the current API key
OPENROUTER_API_KEY=sk-or-v1-... openrouter models user --json

# EU in-region filtered view
openrouter models user --region eu

# compare provider endpoint performance for one model
openrouter models endpoints openai/gpt-4o-mini --sort latency

# inspect the current key
openrouter key info

Run openrouter --help for the full command reference.

Module usage

import { OpenRouterClient, applyModelFilters } from "openrouter-model-explorer";

const client = new OpenRouterClient({
  apiKey: process.env.OPENROUTER_API_KEY,
});

const { data } = await client.getUserModels();
const models = applyModelFilters(data, {
  support: "tools",
  "max-prompt-price": 5,
  limit: 5,
});

console.log(models.map((model) => model.id));

Available exports include:

  • OpenRouterClient
  • OpenRouterError
  • resolveBaseUrl
  • parseArgs
  • annotateModelAccess
  • applyModelFilters
  • normalizeModel
  • normalizeEndpoint
  • sortEndpoints
  • main

Release flow

Versioning and npm publication are handled by GitHub Actions.

  • ci.yml runs npm ci, npm run build, and npm test on pushes and pull requests.
  • release.yml uses release-please to open or update release PRs from Conventional Commit history.
  • When a release is cut on main, the workflow runs the same build and test steps before npm publish.

Bootstrap note:

  • npm trusted publishing only works after the package already exists on npm.
  • Publish openrouter-model-explorer manually once from an npm account with publish rights.
  • After that first publish, configure npm trusted publishing for this repository and point it at release.yml.

npm documents that trusted publishing from GitHub Actions requires id-token: write, Node 22.14.0 or newer, and an existing package record on npm.

Agent and script integration

  • Use --json for machine-readable output on all data commands.
  • In --json mode, failures are emitted on stderr as a single-line JSON object: {"error":{"code":"...","message":"..."}}
  • Successful command payloads are emitted on stdout.
  • Use --version (or -v) to detect installed capabilities before issuing commands.

Exit codes

  • 0: success
  • 1: invalid input or usage error
  • 2: authentication error (missing or rejected API key)
  • 3: API returned an error response
  • 4: network/transport failure (including timeout)