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

@ravshansbox/pi-quota

v0.10.15

Published

Anthropic and OpenAI Codex quota status extension for pi

Readme

pi-quota

Anthropic and OpenAI Codex quota status extension for pi.

Install

pi install npm:@ravshansbox/pi-quota

Add -l to install it in project settings.

Usage

Pi loads the extension from ./index.ts and shows the used quota for the provider backing the active model in the footer when pi runs in the TUI.

  • Calls the Anthropic usage endpoint once on session start, then reads the Anthropic quota from the rate limit headers of each Anthropic response, and calls it again after the reset ping (or at the reset when the active model is not from Anthropic)
  • Polls the OpenAI Codex usage endpoint on session start, then at every 10-minute wall-clock mark (HH:00, HH:10, HH:20, HH:30, HH:40, HH:50)
  • Shows a footer status for the provider backing the active model, and only when quota data for that provider has been polled; switching models re-renders it immediately
  • The text stays compact, e.g. 7% 1h29m · 33% 4d, where the 5-hour window comes first and the 7-day window second, and each window shows its used percentage followed by time until reset
  • Available resets, when present, are appended as · 2x 5h (count, then time until the soonest expires)
  • Both providers are checked on session start whenever their credentials exist, so quota is already known when the active model changes
  • Refreshes Anthropic and OpenAI Codex OAuth access tokens from ~/.pi/agent/auth.json when needed, writes updated credentials back (re-reading the file first to avoid clobbering concurrent updates), and notifies on the first successful refresh per provider each session
  • Appends poll and token-refresh errors to ~/.pi/agent/pi-quota.log
  • Does nothing outside the TUI (RPC, JSON and print modes, including subagents)

Configuration

No configuration is required. OAuth credentials for Anthropic and OpenAI Codex are read from ~/.pi/agent/auth.json.

To redeem a saved OpenAI Codex reset automatically when the 7-day window is exhausted, add this to ~/.pi/agent/settings.json:

{
  "quota": {
    "codexResets": { "autoRedeem": true }
  }
}

Development

npm install
npm run check