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

@henryqw/pi-multi-codex

v3.1.0

Published

Use multiple ChatGPT Codex OAuth accounts in Pi.

Readme

@henryqw/pi-multi-codex

Add multiple ChatGPT Codex OAuth accounts and start Pi work on the eligible slot with the most weekly quota. The extension switches away from active five-hour blocks and can retry an HTTP 429 on another eligible slot.

Pi showing Codex account quotas and the active footer slot Flowchart separating fresh-quota startup ranking from broader HTTP 429 failover

Install

pi install npm:@henryqw/pi-multi-codex

Requires Pi 1.1.0 or later in the 1.x series.

Works with

| Package | Relationship | Purpose | | --- | --- | --- | | @henryqw/pi-footer | Improves | Shows the active slot's quota or five-hour block in the footer. | | @henryqw/pi-subagent | Improves | Isolated children keep Main's active Codex slot. | | @henryqw/pi-task-models | Improves | Numbered slots share one profile route. |

Use

Run /login and authenticate OpenAI Codex (legacy) for slot 1 first. Run /codex-add, then run /login and select the new OpenAI Codex #<n> provider. Restart Pi or update model scope, then run /codex-status. The status lists the new slot with cached quota when available, or unavailable until the first successful snapshot.

| Surface | Type | Purpose | | --- | --- | --- | | /codex-add | command | For people: create the next numbered slot, then authenticate that slot. | | /codex-status | command | For people: show shared quota snapshots and five-hour blocks; never waits on network. | | /codex-switch | command | For people: select an authenticated, scope-allowed slot for the current Codex model. | | Pi model selector (OpenAI Codex (legacy), OpenAI Codex #<n>) | ui | Choose an authenticated account slot. | | Pi status pi-multi-codex | ui | Report the active slot's fresh quota, five-hour limit countdown, or stale/unavailable state; @henryqw/pi-footer displays it in the footer. |

The footer and /codex-status show the five-hour reset countdown for Free, Go, and Plus tiers. They show the seven-day reset countdown for Pro Lite and other tiers. A numbered slot is one Codex account position in Pi.

Flow

  • Before the first agent start, only fresh quota snapshots enter startup ranking. The slot with the most seven-day quota wins.
  • An explicit model selection always wins for the next agent start.
  • Before later agent starts, a known active five-hour block switches to the eligible fresh slot with the most seven-day quota.
  • After HTTP 429, failover can use authenticated, registered, scope-allowed, untried slots with stale or missing quota.
  • Failover skips known active five-hour blocks. It ranks fresh known quota first, then unranked slots by slot number.
  • Routing preserves the model ID.
  • Only physical Codex models are slots. A virtual model listed under openai-codex, such as openai-codex/auto, is never routed to a slot and shows no quota status.
  • During one agent run, each eligible slot is tried at most once after HTTP 429 responses.
  • Automatic retry stops when no untried eligible slot remains.
  • The footer shows the active slot's fresh quota or five-hour block.

Config

Package-owned: ~/.pi/agent/config/pi-multi-codex/config.json

| Name | Description | Values | Default | | --- | --- | --- | --- | | autoSwitchOn429 | Switches to another eligible slot after an HTTP 429. | Boolean. | true when the config file is missing |

Edit this file yourself; the extension does not create or write it. A missing file uses the default true, and config changes take effect at the next session start. Set autoSwitchOn429 to false to disable automatic switching. A present config must contain only this field as a boolean. Invalid config is preserved, warns, and disables automatic switching for the session. Fix the file and start a new session to recover.

State and storage

The extension maintains a generated, credential-free quota cache at ~/.pi/agent/config/pi-multi-codex/usage.json.

Limits and recovery

The extension reads auth.json to identify account slots but does not directly edit credentials. When it asks Pi's auth resolver for a token to check quota, Pi may refresh expired OAuth credentials and update its auth store.

Scoped sessions can switch only to exact scoped aliases.