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

opencode-openrouter-metadata

v0.1.2

Published

OpenCode plugin that discovers models through any OpenAI-compatible `/v1/models` endpoint and preserves OpenRouter-style reasoning metadata, capabilities, limits, modalities, and pricing.

Readme

OpenCode OpenRouter Metadata

OpenCode plugin that discovers models through any OpenAI-compatible /v1/models endpoint and preserves OpenRouter-style reasoning metadata, capabilities, limits, modalities, and pricing.

Development

npm install
npm run typecheck
npm run test:run
npm run build

The build generates the OpenCode model schema from the matching OpenCode Git tag. Specify the target version with a command-line argument or environment variable:

npm run build -- --opencode-version=1.18.16
$env:OPENCODE_VERSION = '1.18.16'; npm run build

Schema generation requires Git and Bun. Set BUN_BINARY when Bun is not on PATH.

At runtime, older OpenCode versions are rejected, matching versions use the generated schema, and newer versions use the older schema as a conservative subset with a warning.

Release Retention

Release automation maintains three release channels:

  • nightly is a rolling prerelease built from main.
  • stable is a rolling release built from the most recent declared project release.
  • opencode-vX.Y.Z compatibility releases are built against the matching OpenCode vX.Y.Z tag.

Compatibility releases are retained independently of nightly and stable. The cleanup policy is:

  • Compatibility releases older than one year are removed first.
  • At least the three newest compatibility releases are always retained.
  • If release assets exceed the configured storage threshold, the oldest compatibility releases are removed until storage is below the threshold or only three remain.
  • If storage is still above the threshold with three releases remaining, cleanup stops and reports a warning rather than deleting one of the required releases.
  • nightly, stable, and versioned project releases are protected from compatibility cleanup.

The default release-asset threshold is 200 MB (200,000,000 bytes). Override it with the repository variable RELEASE_STORAGE_THRESHOLD_BYTES when needed.

Behavior

  • Targets every configured provider that exposes a string options.baseURL by default.
  • Restrict to a subset with plugin options: [["opencode-openrouter-metadata", { "providers": ["my-gateway"] }]].
  • Maps reasoning.supported_efforts into OpenCode reasoning variants.
  • Omits the none variant when upstream marks reasoning as mandatory.
  • Preserves the complete upstream model record under the normalized model's openrouter field.
  • Deep-merges configured model overrides over discovered metadata.
  • Leaves existing models unchanged if discovery fails.
  • Never logs credentials or request bodies.

Global Installation

The installed package is loaded by the global OpenCode config. After installation, fully restart OpenCode Desktop and verify with:

opencode models my-gateway --refresh --verbose

Provider Configuration

Any provider that exposes an OpenAI-compatible /v1/models endpoint is discovered. The plugin reads provider.<id>.options.baseURL and provider.<id>.options.apiKey when present.