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

@tokenswim/pi

v0.1.6

Published

Use Tokenswim's OpenAI and xAI models in the pi coding agent with a single API key.

Readme

@tokenswim/pi

Use Tokenswim's models in the pi coding agent. One API key, no per-vendor accounts.

Supports pi 0.87.1 through 1.x; development checks use pi 1.1.0. The extension uses pi's native provider API and built-in OpenAI Responses implementation.

The Model Catalog includes GPT-5.5, GPT-5.6 Luna/Sol/Terra, GPT-6 Astra/Luna/Sol, GPT-6.1 Sol, and Grok 4.5/4.6/4.7, with Tokenswim's published prices.

Install

pi install npm:@tokenswim/pi

Then log in — pi prompts for the key and checks it against the gateway before storing it, so a mistyped key fails immediately rather than on your first message:

/login tokenswim

Get a key at https://tokenswim.app/dashboard/keys.

Prefer environment variables? Set TOKENSWIM_API_KEY instead and skip the login. A key stored by /login takes precedence over the variable.

Configuration

| Variable | Purpose | | --- | --- | | TOKENSWIM_API_KEY | API key, used when none is stored by /login | | TOKENSWIM_BASE_URL | Gateway address, default https://tokenswim.app/v1 |

TOKENSWIM_BASE_URL is also read from the credential's own env block in pi's auth file, so one machine can hold keys for more than one gateway:

{
  "tokenswim": {
    "type": "api_key",
    "key": "sk-...",
    "env": { "TOKENSWIM_BASE_URL": "https://gateway.example.com/v1" }
  }
}

Development

bun install
bun run check          # typecheck + tests, no network, no credentials
bun run test:drift     # compare the catalog against tokenswim.app/pricing

./ext.sh registers a local checkout with pi and verifies it actually loaded — pi fails silently on a broken extension, so the install message alone proves nothing:

./ext.sh install       # register, then confirm the models appear
./ext.sh status        # is it installed, and what does it expose
./ext.sh try           # run pi once with it, touching no settings
./ext.sh uninstall

A local install is registered by path, never copied, so edits under src/ are live in the next pi session — /reload picks them up without restarting.

To send one real request (spends balance):

bun run smoke              # gpt-6-luna, the cheapest model
bun run smoke gpt-6.1-sol
bun run smoke grok-4.5

License

MIT