Skip to content

About

Codex quota widget in a Steins;Gate-inspired Nixie-tube style|命运石之门辉光管风格 Codex 额度悬浮工具

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Codex Divergence Meter

Windows .NET Framework License: MIT

命运石之门辉光管风格的 Codex 额度悬浮监控工具。

A lightweight Codex quota widget styled as a Steins;Gate-inspired Nixie-tube instrument panel.

实时查看 Codex 剩余额度、官方重置时间、本地 Token 使用速率与 API 等价价值,并在任务完成或手动目标时间临近时给出简洁提示。应用为单文件 Windows 桌面程序,不上传遥测,也不展示任务内容。

Monitor remaining Codex quota, the official reset time, locally estimated token throughput, and API-equivalent token value. The widget also provides discreet completion and target-time reminders without displaying task content. It is a portable, single-file Windows application with no telemetry.

下载最新版本 / Download the latest release

更新记录 / Changelog

中文

功能

  • 实时额度:通过本机 Codex app-server 读取官方限额和重置时间,并每 30 秒兜底刷新。
  • 手动目标:设置你预计的下一次余额刷新时间,与官方重置时间分别显示。
  • 余额提醒:默认在目标时间前 60 分钟和 15 分钟提醒;只在剩余额度达到设定阈值时触发。
  • Token 速率:解析本地主任务追加的 token_count 事件,以线性辉光管进度条显示估算 Token/min。
  • 赚钱量 / API 等价价值:MTH 显示本月已扫描 Token 的 API 等价价值减月订阅费;RUN 实时累计本次小工具运行期间观察到的 API 等价价值。
  • 可配置价格:分别设置非缓存输入、缓存读取、缓存写入、输出的每百万 Token 单价,以及月订阅费;金额统一使用 USD。
  • 任务完成提示:检测到本地主任务完成后,短暂闪烁仪表边框并显示托盘通知,不展示任务内容。
  • 辉光管界面:三只烟色数字管、独立 % 单位、暗阴极栈和连续线性气体放电管。
  • 悬浮与托盘:支持窗口置顶、拖动、隐藏到系统托盘和可选的开机启动。

使用

  1. 从 Releases 下载 ZIP。
  2. 解压并运行 CodexDivergenceMeter.exe。
  3. 拖动顶部区域移动窗口;点击右上角齿轮展开设置。
  4. 输入目标日期与时间后点击 SET;点击 CLR 清除目标。
  5. 在 API VALUE 区按实际模型和订阅修改价格,点击该区的 SET 保存。
  6. 关闭按钮会将程序隐藏到托盘;从托盘菜单可以重新显示或退出。

MTH 在程序启动、跨月和手动点击 ↻ 时扫描一次活动及已归档的本地 rollout;RUN 随本地 token_count 事件更新。默认 API 价格按 GPT-5.6 Sol 设置为输入 $4、缓存输入 $0.40、缓存写入 $5、输出 $20 / 1M Token;默认订阅费是可修改的 $20 占位值。请根据实际模型、套餐和币种账单调整。价格依据见 OpenAI GPT-5.6 Sol 官方模型页。

这是本地编译的未签名个人程序,Windows 首次运行时可能显示 SmartScreen 提示。

设置保存在:

%LOCALAPPDATA%\CodexDivergenceMeter\settings.json

隐私边界

  • Token/min 与完成提示只监控本机 Codex Desktop、CLI 和 IDE 产生的顶层任务;价值统计会计入顶层任务及子代理的 token_count,避免漏算委派消耗。
  • 会话日志只解析 session_meta、token_count 和 task_complete 的必要元数据;月度扫描会在识别到无关记录后立即丢弃缓冲。
  • 解析器在 last_agent_message 字段之前停止缓存,不保留或显示提示词、回复正文与任务内容。
  • 不上传遥测,不读取或显示认证令牌。

从源码构建

无需安装 NuGet 包。构建脚本使用 Windows 自带的 .NET Framework 4.8 C# 编译器:

powershell -NoProfile -ExecutionPolicy Bypass -File .\build.ps1 -Clean -Test

真实额度连接测试:

.\dist\CodexDivergenceMeter.Tests.exe --live

本地月度统计性能检查:

.\dist\CodexDivergenceMeter.Tests.exe --monthly-live

视觉演示模式:

.\dist\CodexDivergenceMeter.exe --demo
.\dist\CodexDivergenceMeter.exe --demo --settings
.\dist\CodexDivergenceMeter.exe --demo --reminder

English

Features

  • Live quota — reads official Codex rate limits and reset times from the local Codex app-server, with a 30-second fallback refresh.
  • Manual target — stores an expected balance-refresh time separately from the official reset time.
  • Balance reminders — alerts at T-60 and T-15 by default, only while remaining quota is above the configured threshold.
  • Token throughput — estimates tokens per minute from locally appended token_count events and renders the value as a continuous linear glow tube.
  • Value meter — MTH shows the scanned local-month API-equivalent value minus the monthly subscription; RUN updates with API-equivalent value observed since the widget started.
  • Editable pricing — separately configures uncached input, cached input, cache writes, output per million tokens, and the monthly subscription in USD.
  • Completion hint — briefly flashes the instrument panel and shows a tray notification when a top-level local task finishes; task content is never shown.
  • Nixie interface — three smoked digit tubes, an external percent marker, layered dark cathodes, and a warm orange gas-discharge rate bar.
  • Desktop widget behavior — draggable, always-on-top capable, tray-aware, and optionally launched at Windows sign-in.

Quick start

  1. Download the ZIP from Releases.
  2. Extract it and run CodexDivergenceMeter.exe.
  3. Drag the header to reposition the widget and use the gear button for settings.
  4. Set an expected refresh date and time with SET, or remove it with CLR.
  5. Adjust the API VALUE rates and subscription for your actual model and plan, then use that section's SET button.
  6. The close button hides the widget to the tray; use the tray menu to show or exit it.

MTH scans active and archived local rollouts at startup, on a month boundary, or when ↻ is clicked; RUN follows newly appended local token_count events. Defaults follow GPT-5.6 Sol at $4 input, $0.40 cached input, $5 cache writes, and $20 output per 1M tokens. The $20 subscription is an editable placeholder. Adjust these values for the actual model, plan, and billed currency. See the official OpenAI GPT-5.6 Sol model page.

The executable is locally built and unsigned, so Windows SmartScreen may appear on first launch.

Settings are stored at:

%LOCALAPPDATA%\CodexDivergenceMeter\settings.json

Privacy

  • Throughput and completion hints watch top-level tasks only. Value accounting includes token_count metadata from both top-level and sub-agent rollouts so delegated usage is not omitted.
  • Parses only the required session_meta, token_count, and task_complete metadata. The monthly scanner drops irrelevant records immediately after prefix classification.
  • Stops buffering before last_agent_message; prompts, responses, and task content are not retained or displayed.
  • Sends no telemetry and does not read or display authentication tokens.

Build from source

No NuGet restore is required. The build uses the .NET Framework 4.8 compiler included with Windows:

powershell -NoProfile -ExecutionPolicy Bypass -File .\build.ps1 -Clean -Test

Optional live quota probe:

.\dist\CodexDivergenceMeter.Tests.exe --live

Optional local monthly-scan performance probe:

.\dist\CodexDivergenceMeter.Tests.exe --monthly-live

Demo modes:

.\dist\CodexDivergenceMeter.exe --demo
.\dist\CodexDivergenceMeter.exe --demo --settings
.\dist\CodexDivergenceMeter.exe --demo --reminder

Known limitations / 已知限制

  • Codex app-server is currently an experimental interface. Protocol changes may require parser updates.

    Codex app-server 目前属于实验接口,协议变更可能需要同步更新解析器。

  • Token/min is a rolling local estimate, not an exact billing meter.

    Token/min 是本地滚动估值,不是精确的计费计量值。

  • Money values are API-equivalent estimates from locally retained rollout logs, not income, refunds, or an OpenAI bill. Mixed-model history and long-context price multipliers are not detected automatically; configure a representative rate profile.

    金额只是本机保留日志对应的 API 等价估值,不是实际收入、退款或 OpenAI 账单;混合模型历史和长上下文倍率不会自动识别,请设置有代表性的价格档。

  • Completion events that occurred before the widget started are not replayed.

    程序启动前已经完成的任务不会补播提示。

Theme notice / 主题说明

The visual style is a fan-made tribute inspired by the laboratory instrumentation and Nixie-tube aesthetic associated with Steins;Gate. This project is not affiliated with or endorsed by the rights holders. No character artwork or copyrighted media assets are included.

界面是对《命运石之门》实验室仪表与辉光管美学的非官方致敬。本项目与相关权利方无关联,也未获得其背书;仓库和程序均不包含角色立绘或受版权保护的媒体素材。

License

Code is released under the MIT License.

About

Codex quota widget in a Steins;Gate-inspired Nixie-tube style|命运石之门辉光管风格 Codex 额度悬浮工具

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages