codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex CLI consumes OpenAI platform credits despite authenticating with ChatGPT Plus account

Open Shaurya-Sethi opened this issue 1 year ago • 9 comments

What version of Codex is running?

0.14.0

Which model were you using?

codex-mini

What platform is your computer?

Windows

What steps can reproduce the bug?

  1. Run codex
  2. Authenticate with ChatGPT account
  3. Perform tasks and observe api credits being used (I went into negative balance)
Image

What is the expected behavior?

Codex CLI should not have consumed api credits as I never provided an API key.

What do you see instead?

Image Image

Additional information

Can assure that I am a plus subscriber - its just that I also happened to have some api credits

Shaurya-Sethi avatar Aug 07 '25 19:08 Shaurya-Sethi

Looks related to my issue: #1953 You can not skip / disable the organisation if you have on created.

Akrelion45 avatar Aug 07 '25 19:08 Akrelion45

True, I just read through it - were you using it from windows or WSL? I'll try installing and using on WSL and update here if it resolves the issue.

They have stated that windows support is limited

Shaurya-Sethi avatar Aug 07 '25 19:08 Shaurya-Sethi

For now, run it with OPENAI_API_KEY= codex to unset OPENAI_API_KEY

bolinfest avatar Aug 07 '25 19:08 bolinfest

@bolinfest That doesnt work on windows

C:\Users\me>set OPENAI_API_KEY= && codex (node:14552) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time (Use node --trace-warnings ...` to show where the warning was created) ╭──────────────────────────────────────────────────────────────╮ │ ● OpenAI Codex (research preview) v0.16.0 │ ╰──────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │ localhost session: 97c36b9a77604f0aa50588f3dbe94d9a │ │ ↳ workdir: C:\Users\me │ │ ↳ model: gpt-5 │ │ ↳ provider: openai │ │ ↳ approval: suggest │ ╰──────────────────────────────────────────────────────────────╯ user test

system
⚠ Insufficient quota: You exceeded your current quota, please check your plan and billing details. For more
information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors. Manage or
purchase credits at https://platform.openai.com/account/billing.`

I have also tried to copy the auth.json from wsl to windows, but then, it just wants to sign in again. (Copying the auth.json from wsl to a debian root server however, works for example)

Akrelion45 avatar Aug 07 '25 19:08 Akrelion45

@bolinfest That doesnt work on windows

C:\Users\me>set OPENAI_API_KEY= && codex (node:14552) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time (Use node --trace-warnings ...` to show where the warning was created) ╭──────────────────────────────────────────────────────────────╮ │ ● OpenAI Codex (research preview) v0.16.0 │ ╰──────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │ localhost session: 97c36b9a77604f0aa50588f3dbe94d9a │ │ ↳ workdir: C:\Users\me │ │ ↳ model: gpt-5 │ │ ↳ provider: openai │ │ ↳ approval: suggest │ ╰──────────────────────────────────────────────────────────────╯ user test

system
⚠ Insufficient quota: You exceeded your current quota, please check your plan and billing details. For more
information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors. Manage or
purchase credits at https://platform.openai.com/account/billing.`

I have also tried to copy the auth.json from wsl to windows, but then, it just wants to sign in again. (Copying the auth.json from wsl to a debian root server however, works for example)

Did you find a solution? I tried to run codex on native windows (No WSL installed on my pc), and i also get the same message like you posted.

iGodly avatar Aug 07 '25 21:08 iGodly

Had the same issue on windows, everything works smooth on wsl. Also, looks like different versions or behaviour on windows/wsl (both insallations via npm):

  1. On windows can't run /status command,
  2. On wsl it exists and returns subscription info

M1kEk1M avatar Aug 08 '25 07:08 M1kEk1M

Had the same issue on windows, everything works smooth on wsl. Also, looks like different versions or behaviour on windows/wsl (both insallations via npm):

  1. On windows can't run /status command,
  2. On wsl it exists and returns subscription info

Do you have also claude code installed? If so, does it installed on windows native or via wsl? I have Claude Code installed on windows native, and im afraid that if i'll install Codex using WSL it will "screw up" my claude code or something like that

iGodly avatar Aug 09 '25 11:08 iGodly

Had the same issue on windows, everything works smooth on wsl. Also, looks like different versions or behaviour on windows/wsl (both insallations via npm):

  1. On windows can't run /status command,
  2. On wsl it exists and returns subscription info

Do you have also claude code installed? If so, does it installed on windows native or via wsl? I have Claude Code installed on windows native, and im afraid that if i'll install Codex using WSL it will "screw up" my claude code or something like that

I have Claude Code installed both in wsl and windows. Shouldn't be a problem at all. you can have both.

Akrelion45 avatar Aug 09 '25 11:08 Akrelion45

This was fixed in https://github.com/openai/codex/pull/1971, so it should be available in 0.19.0 or later. Though I would strongly recommend using the latest version (currently 0.21.0: https://github.com/openai/codex/releases).

bolinfest avatar Aug 13 '25 00:08 bolinfest