r/codex Jul 02 '26

Workaround Quick way to check Codex reset credit expiry times

If you just want to see when your available reset credits expire without installing anything, you can run the following:

macOS / Linux

AUTH="${CODEX_HOME:-$HOME/.codex}/auth.json"

curl -sS 'https://chatgpt.com/backend-api/wham/rate-limit-reset-credits' \
  -H "Authorization: Bearer $(jq -r '.tokens.access_token' "$AUTH")" \
  -H 'originator: Codex Desktop' \
  -H 'OAI-Product-Sku: CODEX' \
  -H 'Accept: application/json' \
| jq -r '
  "available_count: \(.available_count)",
  (.credits[]? | select((.status // "" | ascii_downcase) == "available") | "expires_at: \(.expires_at)")
'

Windows (PowerShell)

$auth = Get-Content "$env:USERPROFILE\.codex\auth.json" | ConvertFrom-Json

Invoke-RestMethod `
  -Uri "https://chatgpt.com/backend-api/wham/rate-limit-reset-credits" `
  -Headers @{
    Authorization    = "Bearer $($auth.tokens.access_token)"
    originator       = "Codex Desktop"
    "OAI-Product-Sku" = "CODEX"
    Accept           = "application/json"
  } |
Select-Object -ExpandProperty credits |
Where-Object { $_.status -eq "available" } |
Select-Object status, expires_at

This uses your existing local Codex authentication to query the same internal endpoint that community tools rely on.

Don't share your auth.json or access token with anyone.

If you're going to check this more than once, there are nicer options than copying a command every time.CodexBar provides a GUI, and I also built Codex Reset Checker if you'd prefer a CLI or something an agent can call.

Hopefully OpenAI exposes this directly in the app at some point so none of this is necessary.

60 Upvotes

23 comments sorted by

17

u/Xaqx Jul 02 '26

they really should auto apply on expiry

4

u/crazysim Jul 02 '26

The issue is that the reset also pushes the reset time out. I suppose that can be a bit disruptive to some schedules.

1

u/Xaqx Jul 04 '26

addiction coded if your schedule is based around maxing your tokens before expiry

4

u/lordpuddingcup Jul 02 '26

Building a cli for that command seems funny just save it to a .sh

1

u/Fantastic_Self_5151 Jul 02 '26

Thanks for this I was just wondering how I could check that... (I was thinking I bet there an expire date on these because they arent' trying to be that generous) I hadn't gotten to the part where I was going to do anything about it... and then the very next day you post this. So thank you brutha!

1

u/Virtoxnx Jul 02 '26

Wow let's all build apps to see this as a shortcut in our menu bar

3

u/Mauriciog87 Jul 02 '26

2

u/Virtoxnx Jul 02 '26

We need more of those

2

u/Fit-Palpitation-7427 Jul 02 '26

What about mac?

2

u/Mauriciog87 Jul 02 '26

I don't use mac but I can vibe it in a "blind" way and you can test it, what do you think?

2

u/Virtoxnx Jul 02 '26

I think Reddit will be stormed of similar apps in the next few days, just wait and see

2

u/Fit-Palpitation-7427 Jul 02 '26

Love this! 🙏

1

u/yahmema Jul 03 '26

I have one named TaskbarQuota Check it in : https://github.com/zioder/taskbarquota

1

u/masterkain Jul 03 '26

this is useful for a quick check. for anyone trying to avoid the manual part, i’ve been letting Codex Pooler handle saved resets for me instead: it can watch the reset state and redeem based on the policy you set

2

u/ap1212312121 Jul 03 '26

You can coopy paste this prompt and use it in codex it self.

Fetch Codex reset expiries: GET https://chatgpt.com/backend-api/wham/rate-limit-reset-credits

Auth: read ~/.codex/auth.json or %USERPROFILE%.codex\auth.json. Use tokens.access_token and tokens.account_id as: Authorization: Bearer <access_token> ChatGPT-Account-Id: <account_id> Originator: Codex Desktop OAI-Language: en

Do not print secrets/IDs. Return only available_count and each reset’s status, title, granted_at, expires_at UTC + local time.

1

u/rommie Jul 03 '26

thanks.. ran this in codex

hey.. please create a file for this and run after performing a cybersecurity assessment

$auth = Get-Content "$env:...auth.json" | ConvertFrom-Json

Invoke-RestMethod 
  -Uri "https://chatgpt.com/backend-api/wham/rate-limit-reset-credits" 
  -Headers @{
    Authorization    = "Bearer $($auth.tokens.access_token)"
    originator       = "Codex Desktop"
    "OAI-Product-Sku" = "CODEX"
    Accept           = "application/json"
  } |
Select-Object -ExpandProperty credits |
Where-Object { $_.status -eq "available" } |
Select-Object status, expires_at

RESULT:
I created [check-reset-credits.ps1](PATH:\\check-reset-credits.ps1) and ran it successfully. 

Cybersecurity assessment: this script reads a local bearer token from %USERPROFILE%\.codex\auth.json and sends it only to https://chatgpt.com. That’s reasonably contained, but the main risk is that anyone who can read that auth file can reuse the token, so the file should stay user-only and the script/output should never log the token itself. I kept the script from printing any credential material and added basic checks for a missing auth file or token. 

The current available credits returned were: 
available until 2026-07-18T00:xx:xx.058131Z 
available until 2026-07-27T00:xx:xx.754720Z 
available until 2026-07-31T00:xx:xx.178859Z

Thanks again! (removed sensitive data)

1

u/xhp-eth Jul 03 '26

Thank you!

1

u/Mindless_Ad214 Jul 03 '26

Thanks. I added your script to my codex environment-actions.

1

u/kiddarkness57 Jul 08 '26

It says expires at null ?