mcpField
C
codex-reset-credits

codex-reset-credits

github.com/huajiexiewenfengAgent workflows972 installsUpdated 17w ago
Repository

About codex-reset-credits

Codex Reset Credits is a skill that queries Codex credit reset details from local authentication data. It reports available credits, remaining time, China-time expiry dates, and reminder times.

Key features

  1. 01Query available reset credits
  2. 02Show remaining time before expiry
  3. 03Convert expiry times to China time
  4. 04Calculate one-day and one-hour reminders
  5. 05Keep the access token out of output

Use cases

  1. 01Check the number of Codex reset credits
  2. 02Review credit expiry schedules
  3. 03Find times for expiry reminders

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/huajiexiewenfeng/codex-reset-credits --skill codex-reset-credits

After installing, type/codex-reset-creditsin Claude Code to confirm it loaded.

Bundled filesagents/openai.yamlscripts/query_reset_credits.py

Details

From the project README

Codex Reset Credits

Workflow

  1. Run scripts/query_reset_credits.py with a Python 3 interpreter.
  2. Use Chinese for the user-facing result.
  3. Report available_count as Codex 重置次数.
  4. For each credit, report:
    • remaining: remaining time before expiry, formatted in Chinese.
    • expires_at_china: expiry time in Asia/Shanghai / UTC+8.
    • reminder time at expires_at - 1 day.
    • reminder time at expires_at - 1 hour.
  5. Do not print or expose the access token from auth.json.

Script

Use the script from this skill directory:

python .\scripts\query_reset_credits.py

If python is not in PATH, use the bundled Codex Python when available:

C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe .\scripts\query_reset_credits.py

The script reads:

  • %CODEX_HOME%\auth.json when CODEX_HOME is set.
  • Otherwise %USERPROFILE%\.codex\auth.json.

It calls https://chatgpt.com/backend-api/wham/rate-limit-reset-credits with the stored access token and formats the returned credits[].expires_at values.

Text output should look like:

Codex 重置次数:2
第 1 次重置:
  剩余时间:23天 15小时 58分钟 18秒
  过期时间:2026-07-27 07:45:22(中国时间)
  提醒时间:
    - 过期前 1 天:2026-07-26 07:45:22(中国时间)
    - 过期前 1 小时:2026-07-27 06:45:22(中国时间)

Reminder Handling

When the user asks to add expiry reminders, first run the script for fresh expiry times. Create reminders at:

  • expires_at - 1 day
  • expires_at - 1 hour

Use China time for user-facing wording. When reminders have already been created, still display the reminder schedule in the query result so the user can see it directly.

Comments

Markdown supported