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

@geminixiang/pi-packyapi

v0.2.1

Published

PackyAPI provider extension for Pi

Readme

@geminixiang/pi-packyapi

A Pi provider extension for PackyAPI. It provides /login API-key entry and a version-controlled catalog assembled from PackyAPI and models.dev.

Install

pi install npm:@geminixiang/pi-packyapi

Run /login, select PackyAPI, and enter your API key. Alternatively set PACKYAPI_API_KEY for the Pi process. If ~/.pi/agent/models.json already contains providers.packyapi, remove that provider block after installing: Pi composes that local definition above extension providers and it would replace this catalog.

Data ownership

| Data | Authoritative source | | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | Raw quota costs, token groups, supported endpoints | PackyAPI pricing | | CNY/USD exchange rate | PackyAPI status | | CNY paid per quota unit | PackyAPI top-up policy | | Models visible to a particular token | Authenticated PackyAPI /v1/models | | Display name, reasoning, text/image input, context/output limits, reasoning options | models.dev, through catalog/model-mapping.json | | Ambiguous ID mappings, Pi API/compat exceptions, Responses client identity | Committed local mapping/overrides |

models.dev costs are intentionally discarded. Raw quotaCost values per million tokens use only PackyAPI's ratios (input = model_ratio × 2; output, cache-read, and cache-write are derived from PackyAPI completion, cache, and cache_creation_ratio_5m values).

Pi receives a real USD-equivalent cost, calculated as:

cost = quotaCost × CNY_PER_QUOTA ÷ usd_exchange_rate

CNY_PER_QUOTA is a committed policy constant of 1, based on PackyAPI's current top-up documentation: 1 CNY purchases 1 USD-named quota unit. The exchange rate is fetched from PackyAPI /api/status (currently 7 CNY/USD). For example, a raw cost of 5 quota per million tokens becomes 5 × 1 ÷ 7 = US$0.714285714286 per million tokens.

These are base USD-equivalent costs. Token-group and peak-pricing multipliers are intentionally not applied because they vary by credential and request time, so actual usage cost can differ. The generated catalog preserves both auditable quotaCost and converted cost, but the runtime provider passes only cost to Pi.

Endpoint selection also comes only from PackyAPI: openai-response is preferred, then openai, then anthropic. The Codex-compatible User-Agent: codex_exec is applied only to Responses models. Anthropic-only models use the Claude-compatible identity required by PackyAPI.

Support policy

The extension supports only PackyAPI IDs with an explicit, reviewable models.dev mapping and a transport that works through Pi. It currently supports 14 models across DeepSeek, GLM, GPT, Grok, Kimi, and MiniMax. Nine visible Claude models remain unsupported because PackyAPI restricts them to the official Claude Code client; codex-auto-review remains unsupported because it has no defensible models.dev capability match. Newly visible but unsupported IDs are reported by the authenticated check and are not guessed or silently exposed.

Pi supports text and image model inputs, so models.dev video and pdf modalities are ignored. Reasoning levels are advertised only when models.dev explicitly lists the corresponding effort; local overrides are reserved for verified transport exceptions.

Maintaining the catalog

catalog/model-mapping.json is the single explicit supported-ID list. To fetch PackyAPI pricing and status plus models.dev capabilities, then deterministically regenerate catalog/models.json:

npm run models:sync

Review and commit the generated diff. It contains no generatedAt, credential, or token-scoped response.

Check committed pricing, exchange-rate, and capability metadata for drift without writing:

npm run models:check

Optionally verify token visibility. This does not update the catalog and does not log the key or full response:

PACKYAPI_API_KEY='...' npm run models:check-auth

Before release, test the package through Pi's real extension loader:

npm run smoke:pi