rate_limit_exceeded Version 0.1.2504301751

Resolved 💬 4 comments Opened May 3, 2025 by Reiko69420 Closed Aug 7, 2025

What version of Codex is running?

0.1.2504301751

Which model were you using?

o4-mini

What platform is your computer?

Ubuntu (WSL2) & Windows 11

What steps can reproduce the bug?

Open Codex,
Type a big prompt,
AI cook for 5 minutes,
Then rate_limit_exceed, codex crash

What is the expected behavior?

Not crash, it should try again after a few seconds multiple times
Or at least just stop the infering and put me back in the prompt writing mod thingy so i don't loose all my context

What do you see instead?

(file:///home/reiko/.nvm/versions/node/v22.14.0/lib/node_modules/@openai/codex/dist/cli.js:474:1514)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async dE.run (file:///home/reiko/.nvm/versions/node/v22.14.0/lib/node_modules/@openai/codex/dist/cli.js:491:2777) {
status: undefined,
headers: undefined,
request_id: undefined,
error: {
type: 'requests',
code: 'rate_limit_exceeded',
message: 'Rate limit reached for o4-mini in organization org-xxxxxxxxxxxxxxxxx on requests per day (RPD): Limit 200, Used 200, Requested 1. Please try again in 7m12s. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing.',
param: null
},
code: 'rate_limit_exceeded',
param: null,
type: 'requests'
}

Additional information

_No response_

View original on GitHub ↗

4 Comments

rivershah · 1 year ago

Fix it! So many dupes for this

``0.1.2504301751``

file:///usr/lib/node_modules/@openai/codex/dist/cli.js:474
`,"\r"]);$g.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function LBe(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 rse(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}m();function v7(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 Od=class 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 MBe(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 c;try{c=JSON.parse(o.data)}catch(d){throw console.error("Could not parse message into JSON:",o.data),console.error("From chunk:",o.raw),d}if(c&&c.error)throw new bi(void 0,c.error,void 0,I7(t.headers));yield c}else{let c;try{c=JSON.parse(o.data)}catch(d){throw console.error("Could not parse message into JSON:",o.data),console.error("From chunk:",o.raw),d}if(o.event=="error")throw new bi(void 0,c.error,c.message,void 0);yield{event:o.event,data:c}}}i=!0}catch(o){if(o instanceof Error&&o.name==="AbortError")return;throw o}finally{i||r.abort()}}return new e(a,r)}static fromReadableStream(t,r){let n=!1;async function*a(){let o=new $g,c=v7(t);for await(let d of c)for(let f of o.decode(d))yield f;for(let d of o.flush())yield d}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 c of a())o||c&&(yield JSON.parse(c));o=!0}catch(c){if(c instanceof Error&&c.name==="AbortError")return;throw c}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 fO({async start(){r=t[Symbol.asyncIterator]()},async pull(a){try{let{value:i,done:o}=await r.next();if(o)return a.close();let c=n.encode(JSON.stringify(i)+`
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

e [Error]: Rate limit reached for o3 in organizationxxxx on tokens per min (TPM): Limit 30000, Used 17207, Requested 24490. Please try again in 23.394s. Visit https://platform.openai.com/account/rate-limits to learn more.
    at e.a [as iterator] (file:///usr/lib/node_modules/@openai/codex/dist/cli.js:474:1514)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async dE.run (file:///usr/lib/node_modules/@openai/codex/dist/cli.js:491:2777) {
  status: undefined,
  headers: undefined,
  request_id: undefined,
  error: {
    type: 'tokens',
    code: 'rate_limit_exceeded',
    message: 'Rate limit reached for o3 in xxx on tokens per min (TPM): Limit 30000, Used 17207, Requested 24490. Please try again in 23.394s. Visit https://platform.openai.com/account/rate-limits to learn more.',
    param: null
  },
  code: 'rate_limit_exceeded',
  param: null,
  type: 'tokens'
}

Node.js v22.15.0
Aylr · 1 year ago

Same issue.

[Error]: Rate limit reached for gpt-4.1 in organization on tokens per min (TPM): Limit 30000, Used 16783, Requested 19596. Please try again in 12.758s. Visit https://platform.openai.com/account/rate-limits to learn more.

parity-error · 1 year ago

I get this same issue repeatedly as well. Happened 4 times to me just yesterday .

codex-maintainers · 1 year ago

Thank you for the feedback! Please try using the latest version of Codex CLI, as we are actively working on improvements and fixes. If the issue persists, let us know.