Skip to content

feat: 增加 OpenAI Codex 余额查询和多语言明细 - #29

Merged
Hotakus merged 3 commits into
Hotakus:masterfrom
huahai0202:feat/codex-balance-i18n
Aug 23, 2026
Merged

feat: 增加 OpenAI Codex 余额查询和多语言明细#29
Hotakus merged 3 commits into
Hotakus:masterfrom
huahai0202:feat/codex-balance-i18n

Conversation

@huahai0202

Copy link
Copy Markdown
Contributor

变更说明

  • 新增 OpenAI Codex OAuth 配额查询。
  • 从 OpenCode 的 auth.json 读取 OpenAI OAuth 凭据。
  • 支持托管账户的 spend_control.individual_limit,并兼容其他 individual_limit 位置。
  • 解析所有 rate-limit 窗口,按 limit_window_seconds 分别展示,避免遗漏短周期或长周期额度。
  • 兼容 reset_after_secondsreset_atresets_at 等重置时间格式。
  • 展示套餐、已用比例、剩余比例、周期、重置时间、Code Review、Credits 和重置次数。
  • 支持插件现有的中文、英文、日文和韩文。
  • 保持其他余额提供商原有显示方式。
  • Hyper 适配已包含在上游 v1.6.4,本 PR 不重复提交。

Go 套餐显示示例

Codex Go 配额截图

该截图展示接口实际返回单一 30 天窗口时的显示结果;插件不会人为添加接口未返回的 7 天窗口。

验证

  • npm run test:balance
  • npm run typecheck
  • npm run build
  • node --check dist/tui.js
  • git diff --check

注意事项

OpenAI 配额接口使用 Codex 当前使用的内部 usage API,未来接口字段变化时可能需要调整。

@Hotakus Hotakus added the feat new feature label Aug 23, 2026
@Hotakus

Hotakus commented Aug 23, 2026

Copy link
Copy Markdown
Owner

感谢你添加的 codex 配额支持,经过简单 review,代码貌似没有大问题,我决定将该 PR 合入主线。感谢你的支持。

@Hotakus
Hotakus merged commit 563577a into Hotakus:master Aug 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants