Rate limit reached for o4-mini
[Error]: Rate limit reached for o4-mini in organization org-***** on tokens per min (TPM): Limit 200000, Used 162960, Requested 42288. Please try again in 1.574s. Visit https://platform.openai.com/account/rate-limits to learn more.
at e.a [as iterator] (file:///Users/*/.nvm/versions/node/v23.7.0/lib/node_modules/@openai/codex/dist/cli.js:443:1514)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async I0.run (file:///Users/*/.nvm/versions/node/v23.7.0/lib/node_modules/@openai/codex/dist/cli.js:460:2513) {
status: undefined,
headers: undefined,
request_id: undefined,
error: {
type: 'tokens',
code: 'rate_limit_exceeded',
message: 'Rate limit reached for o4-mini in organization org-** on tokens per min (TPM): Limit 200000, Used 162960, Requested 42288. Please try again in 1.574s. Visit https://platform.openai.com/account/rate-limits to learn more.',
param: null
},
code: 'rate_limit_exceeded',
param: null,
type: 'tokens'
}
28 Comments
We're working on a fix here to handle these gracefully and continue.
@danielj86 this error is expected because:
The plan is to sleep and retry later when there are tokens again to be used.
@theabhinavdas thank you for the math. it was very helpful.
@tibo-openai
i like the speed of codex compared to claude code.
it will be much better to incrase API limits for codex users instead of adding sleeps, but i assume its not that easy.
thanks
Rudimentary fix in https://github.com/openai/codex/pull/105, we're working on exposing more structured information that will allow this to be better in the not too distant future, but right now it will just sleep for 15s and retry.
Fix released 0.1.4161352
@tibo-openai - just installed and tested with 0.1.4161352 however the issue does not appear to be fixed. Still hitting a rate limit on tokens.
@tibo-openai Still getting rate limits with 0.1.4161352
Its fair to expect OpenAI run the most basic sanity tests before releasing a product..
[Error]: Rate limit reached for o4-mini in organization org-on tokens per min (TPM): Limit 200000, Used 173143, Requested 41255. Please try again in 4.319s. Visit https://platform.openai.com/account/rate-limits to learn more.
at e.a [as iterator] (file:///Users//.nvm/versions/node/v23.7.0/lib/node_modules/@openai/codex/dist/cli.js:445:1514)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async R0.run (file:///Users//.nvm/versions/node/v23.7.0/lib/node_modules/@openai/codex/dist/cli.js:462:2639) {
status: undefined,
headers: undefined,
request_id: undefined,
error: {
type: 'tokens',
code: 'rate_limit_exceeded',
message: 'Rate limit reached for o4-mini in organization org-on tokens per min (TPM): Limit 200000, Used 173143, Requested 41255. Please try again in 4.319s. Visit https://platform.openai.com/account/rate-limits to learn more.',
param: null
},
code: 'rate_limit_exceeded',
param: null,
type: 'tokens'
}
I hit the same issue, the annoying part is to give it context again especially if it was a long running task.
I’m getting exactly the same error, and since the Codex CLI kicks me out every time, I lose 200,000 tokens for nothing.
The product is unusable in its current state.
I just ran the Quickstart example:
codex "explain this codebase to me"and hit the limit.
What I hate is how nonsensical OpenAI rate limits are. It tells me to wait N minutes usually, some arbitrary number like 2.5 minutes, but you don't know actually how many tokens are actually released to use, so you wait that time, and hit with rate limit immediately. You wait overnight, and still can't get one request to finish without hitting rate limit. What's worse, is you're paying for a service to use, and can't use it. When you're new, getting into this for a project, you're simply forced to bend a knee to OpenAI and wait 7 days before tier gets upgraded. Like what? Excuse me? I gave you over hundred dollars, and have a ChatGPT account for years where I've paid hundreds...
Still seeing the error in the latest version, installed yesterday. What perplexes me is I can get Claude code to review some code and fix it and it will tell me for example "used 10K tokens" but if I get o4-mini via Codex CLI to do the same thing I get the consumed 167890 tokens need 44506 tokens try again in 15ms rate limit etc - can someone explain to me why 1 tool seemingly is using less tokens Per Minute than the other? I mean If I am not mistaken isn't the context window only 200000 tokens? why is Codex burning through more tokens? in theory it would mean the cost per use would be higher as well given we are charged based on a MTOK / M tokens
I burned through over 10 bucks today, and haven't gotten a successful output (and put a lot of money into this system to use for a current project and two more we had lined up).
Here are my core concerns:
"In conclusion" (lol) I feel this is kinda geared at people with higher tiers, or (real) organization access via contracts to hound their servers.
Still presented with
$ codex --version
0.1.2504172351
PLEASE REOPEN
Just installed codex today (version
0.1.2504172351) and immediately got this error.Just tried codex for the first time today, purchased enough credits to cover the usage, and hit this after about an hour. It would be great if codex could keep track of how many TPMs it's sending and rate-limit itself to avoid hitting the rate limit. It wouldn't be a huge deal to have it take longer to complete, but having it blow up and exit, losing the entire context makes it not very useful. It's the same problem with Github Copilot in agent mode, except it doesn't crash-out and lose the context.
FWIW, I'm using 0.1.2504211509 and this issue is still present.
@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
Same here. Last version (0.1.2504172351) and the first demo query "explain codebase" hits this error.
@tibo-openai This still isn't fixed. Just happened to me and I've only had this installed for about 30 minutes.
Still have the issue:
on same version, also have the same issue still.
Added 10$ today, used "Explain this code to me" on a relatively small size project and hit the limit immediately, did not get any useful output. Just a waste of my money. I guess I'll stick with claude for a bit longer, until this mess is sorted out.
issue still exist today, why is this closed?
Any news on this? Still heppening and makes Codex for me pretty unusable :(
In August and this is still happening