| name | codex-reset-credits |
| description | Check Codex reset credit availability and expiration times from local Codex ChatGPT auth. Use when the user asks how many Codex reset credits they have, when reset credits expire, how to query reset-credit expiry from ~/.codex/auth.json, or wants a read-only script/CLI for Codex rate-limit reset credits. |
Codex Reset Credits
Overview
Use this skill to check banked Codex reset credits without consuming them. The bundled script reads the local Codex ChatGPT access token from ~/.codex/auth.json and sends a single read-only request.
This is an unofficial workflow around an unsupported ChatGPT backend endpoint. Treat endpoint failures as normal drift, not as user error.
Safety Rules
- Only call
GET https://chatgpt.com/backend-api/wham/rate-limit-reset-credits.
- Never call
/consume, POST, or any endpoint that redeems a reset credit.
- Never print access tokens, refresh tokens, account ids, credit ids, profile user ids, profile images, or invitee email descriptions.
- Never paste the raw API response into chat or docs. Summarize only the safe fields listed below.
- Treat the endpoint as unsupported and drift-prone. If it fails, report the HTTP status and suggest rerunning
codex login.
Quick Start
From this skill folder:
python3 scripts/check_reset_credits.py
Useful options:
python3 scripts/check_reset_credits.py --json
python3 scripts/check_reset_credits.py --tz Asia/Taipei
python3 scripts/check_reset_credits.py --auth ~/.codex/auth.json
If the repository CLI is available, this equivalent command is acceptable:
codex-reset-credits --tz Asia/Taipei
Workflow
- Locate
auth.json from --auth, $CODEX_HOME/auth.json, or ~/.codex/auth.json.
- Read
tokens.access_token; include tokens.account_id only as a request header if present.
- Send the read-only GET request.
- Return
available_count, total_earned_count, and safe per-credit fields: status, title, granted time, expiry time, and remaining duration.
- Summarize in the user's requested timezone. Default to the machine timezone.
Safe JSON fields are:
available_count
total_earned_count
checked_at
timezone
credits
status
title
granted_at
expires_at
remaining
Failure Handling
- Missing auth file or token: ask the user to run
codex login.
- HTTP 401 or 403: tell the user the local ChatGPT token may be expired and suggest
codex login.
- Endpoint shape changes: include the top-level keys returned, avoid dumping raw sensitive payloads, and update the script if needed.
- Before committing changes to this repo, run the leak checks in
README.md or SECURITY.md.
Resources
scripts/check_reset_credits.py: deterministic read-only checker using only Python standard library.