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

pi-cliproxyapi-quota

v0.2.5

Published

Pi extension: view subscription quota for every OAuth provider CLIProxyAPI holds (Claude, Antigravity/Gemini, Codex, Kimi, xAI) inside pi, plus a /think command and thinking-level footer.

Readme

pi-cliproxyapi-quota

npm version license

English | 中文

A pi extension for users who route their AI subscriptions into pi through CLIProxyAPI / EasyCLIProxyAPI.

It adds two things pi doesn't surface for reverse‑proxied models:

  1. Quota — see subscription limits for every OAuth provider the proxy holds without leaving pi.
  2. Thinking level — a /think command and a footer indicator for the active reasoning effort.

Supported providers: Claude, Antigravity / Gemini Code Assist, and Kimi (verified), plus Codex and xAI / Grok (best‑effort, shown as (unverified) until confirmed against a real account — see Scope).

Features

| Trigger | What it does | |---|---| | /quota | For each credential the proxy holds, show every quota window: used %, remaining %, reset countdown. | | Ctrl+Shift+Q | Same as /quota, but works while the model is streaming (it's a shortcut, not a queued command). | | footer Quota[claude] 5h 64% left · 7d 95% left | Remaining % for the provider of the current model (follows model switches; falls back to the first credential). Auto‑refreshed at the start/end of each turn (throttled to 60s). | | /think [level] | Show or set thinking level (off/minimal/low/medium/high/xhigh/max), clamped to the model. | | footer 🧠 high | Always‑visible current thinking level (native Shift+Tab also cycles it). |

The quota data path mirrors the EasyCLIProxyAPI control panel exactly: the proxy management API POST /v0/management/api-call proxies each provider's own usage endpoint (e.g. Anthropic /api/oauth/usage, Google retrieveUserQuotaSummary) using the stored OAuth credential. These endpoints report utilization; they do not consume quota. Disabled credentials are skipped.

Install

pi install npm:pi-cliproxyapi-quota
# or from git:
pi install git:github.com/songhuiming2007-coder/pi-cliproxyapi-quota

Or load a local checkout by adding its path to ~/.pi/agent/settings.json:

{ "extensions": ["/absolute/path/to/pi-cliproxyapi-quota/index.ts"] }

Reload pi (/reload) after installing.

Configuration

No secrets are stored in this package. At runtime it resolves:

Base URL (proxy): CLIPROXYAPI_BASE_URL~/.pi/agent/cliproxyapi.json baseUrlhttp://127.0.0.1:8317

Management key (required for /quota), in order:

  1. env CLIPROXYAPI_MANAGEMENT_KEY
  2. ~/.pi/agent/cliproxyapi-quota.json{ "managementKey": "..." }
  3. EasyCLIProxyAPI GUI config.toml (management-secret-key), auto‑located per‑OS:
    • macOS: ~/Library/Application Support/com.cpa.gui/config.toml
    • Linux: $XDG_CONFIG_HOME/com.cpa.gui/config.toml
    • Windows: %APPDATA%\com.cpa.gui\config.toml

If you don’t run the GUI, set CLIPROXYAPI_MANAGEMENT_KEY (must match your proxy's remote-management.secret-key) or the JSON override.

Scope & limitations

  • Verified (tested against live accounts): claude, antigravity / gemini.
  • Unverified (ported from the EasyCLIProxyAPI panel, endpoints + parsers wired but not yet tested against a real account): codex, xai / grok. These are labelled (unverified) in the output. If one is wrong for your account, please open an issue with the raw response — easy to fix.
  • Reads a local management key to call the localhost management API; nothing is sent anywhere except your own proxy and each provider's usage endpoint (through that proxy). Disabled credentials are skipped.

License

MIT


中文说明

适用于通过 CLIProxyAPI / EasyCLIProxyAPI 把各 AI 订阅接入 pi 的用户。它补上了 pi 对反向代理模型不暴露的两件事:

  1. 额度 — 在 pi 里直接看代理持有的每个 OAuth 提供方的订阅限额。
  2. 思考强度/think 命令 + footer 常驻显示当前推理档位。

支持的提供方:ClaudeAntigravity / Gemini Code AssistKimi(已验证),以及 CodexxAI / Grok(尽力支持,在真实账号上校准前显示为 (unverified))。

功能

| 触发 | 作用 | |---|---| | /quota | 对代理持有的每个凭证,显示其所有配额窗口:已用 %、剩余 %、重置倒计时。 | | Ctrl+Shift+Q | 同 /quota,但模型正在输出时也能按(快捷键,不会被排队)。 | | footer Quota[claude] 5h 64% left · 7d 95% left | 显示当前模型对应服务的剩余 %(随模型切换,取不到时回退到第一个凭证);每轮开始/结束自动刷新(60s 节流)。 | | /think [level] | 查看/设置思考强度(off/minimal/low/medium/high/xhigh/max,受模型能力限制)。 | | footer 🧠 high | 常驻显示当前思考强度(原生 Shift+Tab 也能循环切换)。 |

取数链路与 EasyCLIProxyAPI 控制面板完全一致:代理管理 API POST /v0/management/api-call 用存储的 OAuth 凭证代理请求各提供方自己的用量端点(如 Anthropic /api/oauth/usage、 Google retrieveUserQuotaSummary)。这些端点只报告用量,不消耗额度;禁用的凭证会跳过。

安装

pi install npm:pi-cliproxyapi-quota
# 或从 git:
pi install git:github.com/songhuiming2007-coder/pi-cliproxyapi-quota

或把本地目录的路径加到 ~/.pi/agent/settings.json

{ "extensions": ["/absolute/path/to/pi-cliproxyapi-quota/index.ts"] }

安装后 /reload 重载 pi。

配置

本包不存储任何密钥,运行时解析:

Base URL(代理):CLIPROXYAPI_BASE_URL~/.pi/agent/cliproxyapi.jsonbaseUrlhttp://127.0.0.1:8317

管理密钥/quota 必需),按顺序:

  1. 环境变量 CLIPROXYAPI_MANAGEMENT_KEY
  2. ~/.pi/agent/cliproxyapi-quota.json{ "managementKey": "..." }
  3. EasyCLIProxyAPI GUI 的 config.tomlmanagement-secret-key),按系统自动定位:
    • macOS:~/Library/Application Support/com.cpa.gui/config.toml
    • Linux:$XDG_CONFIG_HOME/com.cpa.gui/config.toml
    • Windows:%APPDATA%\com.cpa.gui\config.toml

不用 GUI 的话,设置 CLIPROXYAPI_MANAGEMENT_KEY(需与代理的 remote-management.secret-key 一致)或用上述 JSON 覆盖。

范围与限制

  • 已验证(在真实账号上实测):claudeantigravity / gemini
  • 未验证(按 EasyCLIProxyAPI 面板移植,端点与解析已接但未在真实账号上跑过):codexxai / grok,输出里标 (unverified)。若某家在你账号上不对,请带原始返回开 issue,很容易修。
  • 仅读取本地管理密钥去调本机管理 API;除了你自己的代理和(经代理的)各提供方用量端点,不向任何地方发送数据;禁用的凭证会跳过。

许可证

MIT