Skip to content

Insufficient quota if you have an organisation created because it always wants to connect to your organisation, even if you want to use the ChatGPT plus/pro subscription instead #1953

Closed

Description

@Akrelion45

What version of Codex is running?

0.16.0

Which model were you using?

gpt-5

What platform is your computer?

Windows

What steps can reproduce the bug?

On Windows, if you log in with the "Sign in with ChatGPT" option, and you are having an organisation on https://platform.openai.com/, it will always connect to the organisation and because of this you are receiving the error message

"⚠ 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."

However it is not possible to delete your default organisation even if it is unused or choose to not connect with the organisation.
Because of that, it is not possible to use codex with your normal chatgpt plus subscription

On WSL, when i did the "codex login" command, where you manually post the url in your browser, it did not want to connect to the organisation at all and everything worked fine.

What is the expected behavior?

Not receiving the insufficient quota error message. Having an option to not connect to the organisation

What do you see instead?

It connects to my organisation and thus wants to use api based credits instead of my subscription

Additional information

No response

Activity

  1. added
    bug
    on Aug 7, 2025
  2. changed the title [-]Insufficient quota if you have an organization created, even if you want to use ChatGPT subscription[/-] [+]Insufficient quota if you have an organisation created because it always want to connect your organisation, even if you want to use the ChatGPT plus/pro subscription instead[/+] on Aug 7, 2025
  3. changed the title [-]Insufficient quota if you have an organisation created because it always want to connect your organisation, even if you want to use the ChatGPT plus/pro subscription instead[/-] [+]Insufficient quota if you have an organisation created because it always wants to connect to your organisation, even if you want to use the ChatGPT plus/pro subscription instead[/+] on Aug 7, 2025
  4. bolinfest commented on Aug 7, 2025

    @bolinfest
    Collaborator

    For now, please run with OPENAI_API_KEY= codex to unset OPENAI_API_KEY and ChatGPT login credits should be preferred.

  5. Southland-FR commented on Aug 7, 2025

    @Southland-FR

    For now, please run with OPENAI_API_KEY= codex to unset OPENAI_API_KEY and ChatGPT login credits should be preferred.

    Image
  6. bolinfest commented on Aug 7, 2025

    @bolinfest
    Collaborator

    You need a space between OPENAI_API_KEY= and codex.

  7. iGodly commented on Aug 7, 2025

    @iGodly

    You need a space between OPENAI_API_KEY= and codex.

    Where do i set the "OPENAI_API_KEY= codex" ? I have the same problem like the guy who opened the issue has.

  8. christophkogler commented on Aug 7, 2025

    @christophkogler
    Contributor

    It's an env var, you can set it in any boot script. I'm running Ubutunu on WSL2 and just throw them in near the end of ~/.bashrc.

    It's more of a pain on Windows. You should be able to find the System Properties tool by searching for 'environment variables' in the start menu, and then you go to the Advanced tab, near the bottom is a Environment Variables button. I believe either a user or system variable would work? You don't need both, just one. And then you need to open a new command prompt.

  9. Akrelion45 commented on Aug 7, 2025

    @Akrelion45
    ContributorAuthor
    Image On WSL it works fine, but not on windows. As you can see the OPENAI_API_KEY is set to be empty and i also restarted the pc, but it still gives the message.
  10. gpeal commented on Aug 7, 2025

    @gpeal
    Contributor

    You need a space between OPENAI_API_KEY= and codex.

    Where do i set the "OPENAI_API_KEY= codex" ? I have the same problem like the guy who opened the issue has.

    You can do this directly from the command line. Run OPENAI_API_KEY= codex instead of codex which will unset OPENAI_API_KEY specifically for that codex invocation

  11. Akrelion45 commented on Aug 7, 2025

    @Akrelion45
    ContributorAuthor

    @gpeal I am feeling a bit stupid right now 😅
    As you can see in the image, just codex works.
    Running the comment like you suggested, does not work.
    I asked chatgpt and it told me:

    "OPENAI_API_KEY= codex is POSIX-shell syntax; cmd.exe doesn’t understand the “inline-assignment” trick.
    Use a one-shot subshell instead:

    cmd /C "set "OPENAI_API_KEY=" && codex""

    This comment did work then, but didn't fix the issue at all as you can see. Still the quota error.

    Image
  12. bolinfest commented on Aug 8, 2025

    @bolinfest
    Collaborator

    You can do this as two steps:

    $ unset OPENAI_API_KEY
    $ codex # ... args for codex

    But if you do that, OPENAI_API_KEY will be unset for the rest of the shell session. Maybe that is fine in your case.

    Alternatively, if you do:

    $ OPENAI_API_KEY= codex # ... args for codex
    

    Then the OPENAI_API_KEY environment variable will be empty for that single invocation of codex, but it does not inset it for your shell session globally.

  13. osichin commented on Aug 8, 2025

    @osichin

    @Akrelion45 - did you manage to fix this? i have the exact same problem on v0.19.0 .

    ⚠ 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 cannot delete the organization and Codex CLI is linking to the "personal" organization that i don't need.

  14. Akrelion45 commented on Aug 8, 2025

    @Akrelion45
    ContributorAuthor

    @osichin No, even the newest updates to codex did not fix it. I deleted my .codex folder and updated to 0.19,
    logged in again, and the error persist. Must be a really weird issue on the windows version of codex..

  15. pakrym-oai commented on Aug 8, 2025

    @pakrym-oai
    Contributor

    @Akrelion45 any chance you can run codex login status ?

  16. SinkHoleLabs commented on Aug 8, 2025

    @SinkHoleLabs

    @Akrelion45 any chance you can run codex login status ?

    When I run this it starts codex then tries to send login as a chat command that gives the same error about quota.

    Running v19 I have deleted auth.json and unintalled and reinstalled multiple times.

    Image
  17. osichin commented on Aug 8, 2025

    @osichin

    I get the same message as the user above if i have billing information set in my "personal" organization - but if i go into my "personal" organization and delete my billing information - i get the following. This is very clear it is trying to link to the organization instead of my personal pro subscription.

    i wish i could just delete this useless "personal" organization i had previously created so that this does not happen.


    codex login status
    ╭──────────────────────────────────────────────────────────────╮
    │ ● OpenAI Codex (research preview) v0.19.0 │
    ╰──────────────────────────────────────────────────────────────╯
    ╭──────────────────────────────────────────────────────────────╮
    │ localhost session: ---------------------------------- │
    │ ↳ workdir: C:----------------- │
    │ ↳ model: codex-mini-latest │
    │ ↳ provider: openai │
    │ ↳ approval: suggest │
    ╰──────────────────────────────────────────────────────────────╯
    user
    login
    ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │( ● ) 6s Thinking press Esc twice to interrupt │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    Ctrl+C to exit | "/" to see commands | Enter to send — 100% context left

    file:///C:/Users/-------/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:586
    ,"\r"]);Qh.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function _Ve(e,t){for(let a=t??0;a<e.length;a++){if(e[a]===10)return{preceding:a,index:a+1,carriage:!1};if(e[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}function Pde(e){for(let n=0;n<e .length-1;n++){if(e[n]===10&&e[n+1]===10||e[n]===13&&e[n+1]===13)return n+2;if(e[n]===13&&e[n+1]===10&&n+3<e.length&&e[n+2]===13&&e[n+3]===10)return n+4}return-1}f();function FL(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{ async next(){try{let r=await t.read();return r?.done&&t.releaseLock(),r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}var ed=clas s e{constructor(t,r){this.iterator=t,this.controller=r}static fromSSEResponse(t,r){let n=!1;async function*a(){if(n)throw new Error("Cannot iterate over a consumed stream, use .tee()to split the stream.");n=!0;let i=!1;try{for await(let o of AVe(t,r))if(!i){if(o.data.startsWith("[DONE]")){i=!0;continue}if(o.event===null||o.event.startsWith("response.")||o.event.startsWith("transcript.")){let s;try{s=JSON.parse(o.data)}catch(u){throw console.error("Could not parse message into JSON :",o.data),console.error("From chunk:",o.raw),u}if(s&&s.error)throw new xi(void 0,s.error,void 0,UL(t.headers));yield s}else{let s;try{s=JSON.parse(o.data)}catch(u){throw console.error("Could not parse message into JSON:",o.data),console.error( "From chunk:",o.raw),u}if(o.event=="error")throw new xi(void 0,s.error,s.message,void 0);yield{event:o.event,data:s}}}i=!0}catch(o){if(o instanceof Error&&o.name==="AbortError")return;throw o}finally{i||r.abort()}}return new e(a,r)}static fromR eadableStream(t,r){let n=!1;async function*a(){let o=new Qh,s=FL(t);for await(let u of s)for(let p of o.decode(u))yield p;for(let u of o.flush())yield u}async function*i(){if(n)throw new Error("Cannot iterate over a consumed stream, use.tee()
    to split the stream.");n=!0;let o=!1;try{for await(let s of a())o||s&&(yield JSON.parse(s));o=!0}catch(s){if(s instanceof Error&&s.name==="AbortError")return;throw s}finally{o||r.abort()}}return new e(i,r)}[Symbol.asyncIterator](){return this .iterator()}tee(){let t=[],r=[],n=this.iterator(),a=i=>({next:()=>{if(i.length===0){let o=n.next();t.push(o),r.push(o)}return i.shift()}});return[new e(()=>a(t),this.controller),new e(()=>a(r),this.controller)]}toReadableStream(){let t=this,r,n=new TextEncoder;return new TB({async start(){r=t[Symbol.asyncIterator]()},async pull(a){try{let{value:i,done:o}=await r.next();if(o)return a.close();let s=n.encode(JSON.stringify(i)+

    e [Error]: Your account is not active, please check your billing details on our website.
    at e.a [as iterator] (file:///C:/Users/------/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:586:1514)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Dy.run (file:///C:/Users/-----/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:603:2832) {
    status: undefined,
    headers: undefined,
    request_id: undefined,
    error: {
    type: 'billing_not_active',
    code: 'billing_not_active',
    message: 'Your account is not active, please check your billing details on our website.',
    param: null
    },
    code: 'billing_not_active',
    param: null,
    type: 'billing_not_active'
    }

    Node.js v24.3.0
    PS C:\dev\github-------->

  18. pakrym-oai commented on Aug 8, 2025

    @pakrym-oai
    Contributor

    Oh, wait both of you are using the wrong codex (old typescript version)

    can you run npm install -g @openai/codex please?

  19. osichin commented on Aug 8, 2025

    @osichin

    @pakrym-oai

    Oh, wait both of you are using the wrong codex (old typescript version)

    can you run npm install -g @openai/codex please?

    see below - uninstalled and re-insalled

    PS C:\dev\github------> npm uninstall -g @openai/codex

    removed 221 packages in 623ms
    PS C:\dev\github-------> npm cache clean --force
    npm warn using --force Recommended protections disabled.
    PS C:\dev\github-------> npm install -g @openai/codex@latest
    npm warn deprecated [email protected]: Use your platform's native DOMException instead

    added 221 packages in 6s

    69 packages are looking for funding
    run npm fund for details
    PS C:\dev\github--------> codex login status
    ╭──────────────────────────────────────────────────────────────╮
    │ ● OpenAI Codex (research preview) v0.19.0 │
    ╰──────────────────────────────────────────────────────────────╯
    ╭──────────────────────────────────────────────────────────────╮
    │ localhost session: ---------------------│
    │ ↳ workdir: C:\dev\github-------------------│
    │ ↳ model: codex-mini-latest │
    │ ↳ provider: openai │
    │ ↳ approval: suggest │
    ╰──────────────────────────────────────────────────────────────╯
    user
    login
    ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │( ● ) 7s Thinking.. press Esc twice to interrupt │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    Ctrl+C to exit | "/" to see commands | Enter to send — 100% context left

    file:///C:/Users/------/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:586
    ,"\r"]);Qh.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function _Ve(e,t){for(let a=t??0;a<e.length;a++){if(e[a]===10)return{preceding:a,index:a+1,carriage:!1};if(e[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}function Pde(e){for(let n=0;n<e .length-1;n++){if(e[n]===10&&e[n+1]===10||e[n]===13&&e[n+1]===13)return n+2;if(e[n]===13&&e[n+1]===10&&n+3<e.length&&e[n+2]===13&&e[n+3]===10)return n+4}return-1}f();function FL(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{ async next(){try{let r=await t.read();return r?.done&&t.releaseLock(),r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}var ed=clas s e{constructor(t,r){this.iterator=t,this.controller=r}static fromSSEResponse(t,r){let n=!1;async function*a(){if(n)throw new Error("Cannot iterate over a consumed stream, use .tee()to split the stream.");n=!0;let i=!1;try{for await(let o of AVe(t,r))if(!i){if(o.data.startsWith("[DONE]")){i=!0;continue}if(o.event===null||o.event.startsWith("response.")||o.event.startsWith("transcript.")){let s;try{s=JSON.parse(o.data)}catch(u){throw console.error("Could not parse message into JSON :",o.data),console.error("From chunk:",o.raw),u}if(s&&s.error)throw new xi(void 0,s.error,void 0,UL(t.headers));yield s}else{let s;try{s=JSON.parse(o.data)}catch(u){throw console.error("Could not parse message into JSON:",o.data),console.error( "From chunk:",o.raw),u}if(o.event=="error")throw new xi(void 0,s.error,s.message,void 0);yield{event:o.event,data:s}}}i=!0}catch(o){if(o instanceof Error&&o.name==="AbortError")return;throw o}finally{i||r.abort()}}return new e(a,r)}static fromR eadableStream(t,r){let n=!1;async function*a(){let o=new Qh,s=FL(t);for await(let u of s)for(let p of o.decode(u))yield p;for(let u of o.flush())yield u}async function*i(){if(n)throw new Error("Cannot iterate over a consumed stream, use.tee()
    to split the stream.");n=!0;let o=!1;try{for await(let s of a())o||s&&(yield JSON.parse(s));o=!0}catch(s){if(s instanceof Error&&s.name==="AbortError")return;throw s}finally{o||r.abort()}}return new e(i,r)}[Symbol.asyncIterator](){return this .iterator()}tee(){let t=[],r=[],n=this.iterator(),a=i=>({next:()=>{if(i.length===0){let o=n.next();t.push(o),r.push(o)}return i.shift()}});return[new e(()=>a(t),this.controller),new e(()=>a(r),this.controller)]}toReadableStream(){let t=this,r,n=new TextEncoder;return new TB({async start(){r=t[Symbol.asyncIterator]()},async pull(a){try{let{value:i,done:o}=await r.next();if(o)return a.close();let s=n.encode(JSON.stringify(i)+

    e [Error]: Your account is not active, please check your billing details on our website.
    at e.a [as iterator] (file:///C:/Users/------/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:586:1514)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Dy.run (file:///C:/Users/------/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:603:2832) {
    status: undefined,
    headers: undefined,
    request_id: undefined,
    error: {
    type: 'billing_not_active',
    code: 'billing_not_active',
    message: 'Your account is not active, please check your billing details on our website.',
    param: null
    },
    code: 'billing_not_active',
    param: null,
    type: 'billing_not_active'
    }

    Node.js v24.3.0
    (octane-worker) PS C:\dev\github------->

  20. SinkHoleLabs commented on Aug 8, 2025

    @SinkHoleLabs

    This is what I got as well

  21. osichin commented on Aug 8, 2025

    @osichin

    may others are posting the same bug @pakrym-oai

    see below:
    #2004

    it's the same issue as this one.

  22. osichin commented on Aug 8, 2025

    @osichin

    i think there may be a fix for this in the works: #2019

  23. Akrelion45 commented on Aug 8, 2025

    @Akrelion45
    ContributorAuthor
    Image

    Yep, same as the 2 other guys.

  24. pakrym-oai commented on Aug 8, 2025

    @pakrym-oai
    Contributor

    I really appreciate your reports. We are working on the fix for this.

    Closing in favor of pinned #2000

  25. added
    windows-os
    on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions