Handle rate limits

Resolved 💬 6 comments Opened Apr 19, 2025 by samyarkd Closed Apr 22, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.1.2504172351

Which model were you using?

o4-mini

What platform is your computer?

ubuntu 24.10 nodejs 22

What steps can reproduce the bug?

Use it on a little big repo

e [Error]: Rate limit reached for o4-mini in organization org-XXX on tokens per min (TPM): Limit 200000, Used 161431, Requested 45504. Please try again
 in 2.08s. Visit https://platform.openai.com/account/rate-limits to learn more.
    at e.a [as iterator] (file:///home/user/.nvm/versions/node/v22.11.0/lib/node_modules/@openai/codex/dist/cli.js:449:1514)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async T0.run (file:///home/user/.nvm/versions/node/v22.11.0/lib/node_modules/@openai/codex/dist/cli.js:466:2933) {
  status: undefined,
  headers: undefined,
  request_id: undefined,
  error: {
    type: 'tokens',

What is the expected behavior?

Wait and try from where it was left

What do you see instead?

Rate limit error and i have to it all over again

Additional information

_No response_

View original on GitHub ↗

6 Comments

Aylr · 1 year ago

Stoked for a fix for this issue. Using version 0.1.2504172351

WASasquatch · 1 year ago

I'm curious, can this actually be fixed without OpenAI aware of Codex and allowing better token usage? The token rate system seems specifically designed so it can't be circumvented by cooldowns anyone could implement in their code. Encouraging you to climb tiers or strike a deal with an OpenAI contract.

wbraswell · 1 year ago

@tibo-openai
STILL NOT FIXED!!!
Lots of bugs open for this one issue?!?
https://github.com/openai/codex/issues?q=is%3Aissue%20state%3Aopen%20rate%20limit

NickSdot · 1 year ago
@tibo-openai STILL NOT FIXED!!! Lots of bugs open for this one issue?!? https://github.com/openai/codex/issues?q=is%3Aissue%20state%3Aopen%20rate%20limit

Let me translate that for you:
Hey Tibo, the issue isn't resolved on my end. Seems like this is a low hanging fruit to get a bunch of duplicate issues closed. Any chance you can prioritise it?

tibo-openai collaborator · 1 year ago

Should be fixed in latest release, please install 0.1.2504221401 and re-open if this is still an issue you encounter.