ai-quota
v0.1.9
Published
Show AI coding-plan quota and API usage budget in the terminal
Maintainers
Readme
AI剩余额度查询,推荐搭配pi-agent使用
Zero runtime dependencies, read-only GETs, no quota consumed.

Color: green (< 50%), yellow (< 80%), red (≥ 80%).
ai-quota
- [x] Claude code :
~/.claude/.credentials.json - [x] OpenAI Codex : pi
openai-codex(legacy)或~/.codex/auth.json - [x] Grok build :
~/.pi/agent/auth.json - [x] Opencode go :
~/.config/ai-quota/opencode.env - [x] Minimax coding plan :
MINIMAX_CN_API_KEYorMINIMAX_API_KEYenv - [x] DeepSeek API :
DEEPSEEK_API_KEY - [x] Kimi coding plan : 待测试,
KIMI_API_KEYorMOONSHOT_API_KEYenv - [x] Zhipu coding plan : 待测试,
ZHIPU_CN_API_KEYorZHIPU_API_KEYenv (cn/intl regions)
Pi 新版 /login openai 使用的订阅共享额度,在 openai·apps 行显示,与普通 Codex 额度分开。数据来自 WHAM 的 chatpass.windows;按服务端窗口显示 5 小时、周额度,不补造缺失窗口。这是账号共享池,不代表 Pi 单独设置的应用上限。
查询仍需 pi openai-codex(legacy)或 Codex 凭据:新版 openai token 面向 api.openai.com/v1,实测无法读取 WHAM。仅有新版凭据时提示查看 ChatGPT Usage。不刷新或改写共享凭据。详见 接口核查。
Usage
bun install -g ai-quota # installai-quota auth list # see which providers are enabled
ai-quota auth disable openai # skip a provider next time
ai-quota auth enable openai # bring it back
ai-quota # all enabled providers
ai-quota -p minimax # set one provider
ai-quota -i 30s # refresh in place every 30s
ai-quota query reset-card -p codex # show Codex reset cards
# 1week 10¥ / 1mon 70¥
ai-quota budget -p deepseek-api -w 10 -m 70ee-quota (Earth Engine quota)
- 完成 Earth Engine 授权并设置项目:
earthengine authenticate
earthengine set_project <PROJECT_ID>- 在网页右上角选择该项目,分别打开并点击启用:
若无法启用,请让项目所有者进入 IAM,点击授予访问权限,添加你的 Google 账号,并授予 Service Usage Admin 角色。
- 启用项目并查询月额度:
ee-quota auth enable gee-hydro
ee-quota auth enable gee-kongdd
ee-quota auth list
ee-quota auth disable gee-kongdd
ee-quota config --unit h # s 或 h
ee-quota # 所有已启用 project
ee-quota -p gee-hydro # 指定 projectEarth Engine 凭据默认位于 ~/.config/earthengine/credentials,详见 Earth Engine Authentication。
