Rate limit reached for o4-mini

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

[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'
}

View original on GitHub ↗

28 Comments

tibo-openai collaborator · 1 year ago

We're working on a fix here to handle these gracefully and continue.

theabhinavdas contributor · 1 year ago

@danielj86 this error is expected because:

  1. you have a limit of 200000 tokens per minute
  2. you've used 162960 tokens within the current minute
  3. you are requesting an additional 42288 tokens within the current minute which would make you go over your TPM limit of 200000
tibo-openai collaborator · 1 year ago

The plan is to sleep and retry later when there are tokens again to be used.

danielj86 · 1 year ago

@theabhinavdas thank you for the math. it was very helpful.

danielj86 · 1 year ago

@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

tibo-openai collaborator · 1 year ago

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.

tibo-openai collaborator · 1 year ago

Fix released 0.1.4161352

beamdotdev · 1 year ago

@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.

danielj86 · 1 year ago

@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'
}

abhishek1234321 · 1 year ago

I hit the same issue, the annoying part is to give it context again especially if it was a long running task.

Philippe-Cohen · 1 year ago

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.

mimoralea · 1 year ago

I just ran the Quickstart example:

codex "explain this codebase to me"

and hit the limit.

WASasquatch · 1 year ago

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

navardituned · 1 year ago

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

WASasquatch · 1 year ago
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:

  • OpenAI's Token based Rate Limit is designed to not be easily circumvented by traditional calls-per-minute cooldown systems like graceful back-off. It's contextual based with tokens.
  • OpenAI's tier system coupled with the Token Rate Limits is designed to encourage pumping in money for tokens, climbing the "tiers", or just going straight to OpenAI for a contract, that other IDE's run off of, etc.
  • No back-end infrastructure, or support, and client-business trust. I've blown through tokens, and no requests are completing, just burned tokens. I should be refunded if the operation is not successful and I do not benefit. AI IDE's do this, such as Windsurf.
  • This is an official OpenAI repo, but seems to have been slapped together, and thrown up here on github with little planning. As a research preview, there should be a team staffed here engaging with us, and improving these core issues.

"In conclusion" (lol) I feel this is kinda geared at people with higher tiers, or (real) organization access via contracts to hound their servers.

mathusiast · 1 year ago

Still presented with

$ codex --version
0.1.2504172351

e [Error]: Rate limit reached for o4-mini in organization org-FaKQtnywbKBWxbRbD5wCG53p on tokens per min (TPM): Limit 200000, Used 150405, Requested 51478. Please try again in 564ms. Visit https://platform.openai.com/account/rate-limits to learn more.
    at e.a [as iterator] (file:///opt/homebrew/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:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:466:2933) {
  status: undefined,
  headers: undefined,
  request_id: undefined,
  error: {
    type: 'tokens',
    code: 'rate_limit_exceeded',
    message: 'Rate limit reached for o4-mini in organization org-FaKQtnywbKBWxbRbD5wCG53p on tokens per min (TPM): Limit 200000, Used 150405, Requested 51478. Please try again in 564ms. Visit https://platform.openai.com/account/rate-limits to learn more.',
    param: null
  },
  code: 'rate_limit_exceeded',
  param: null,
  type: 'tokens'
}

PLEASE REOPEN

aarondfrancis · 1 year ago

Just installed codex today (version 0.1.2504172351) and immediately got this error.

codebrainz · 1 year ago

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.

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

averkij · 1 year ago

Same here. Last version (0.1.2504172351) and the first demo query "explain codebase" hits this error.

greggh · 1 year ago

@tibo-openai This still isn't fixed. Just happened to me and I've only had this installed for about 30 minutes.

ziadmoubayed · 1 year ago

Still have the issue:

codex --version
0.1.2504172351
SDDoSx · 1 year ago
Still have the issue: `` codex --version 0.1.2504172351 ``

on same version, also have the same issue still.

webpolis · 1 year ago
codex -p gemini -m gemini-2.5-pro-preview-05-06
╭──────────────────────────────────────────────────────────────╮
│ ● OpenAI Codex (research preview) v0.1.2505172129            │
╰──────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────╮
│ localhost session: 49184170944b4746a68fe1313ce51f2a          │
│ ↳ workdir: ~/.../project/app               │
│ ↳ model: gemini-2.5-pro-preview-05-06                        │
│ ↳ provider: gemini                                           │
│ ↳ approval: suggest                                          │
╰──────────────────────────────────────────────────────────────╯
user
Briefly describe this project.

    system
    ⚠️  Rate limit reached. Error details: Status: 429, Code: unknown, Type: unknown, Message: 429 status code
    (no body). Please try again later.
nccvector · 1 year ago

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.

e [Error]: Rate limit reached for gpt-4o in organization org-xxxxxxxxxxxxxxxxx on tokens per min (TPM): Limit 10000, Used 6630, Requested 3787. Please try again in 2.502s. 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.
    at e.a [as iterator] (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:582:1514)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async ky.run (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:599:2785) {
  status: undefined,
  headers: undefined,
  request_id: undefined,
  error: {
    type: 'tokens',
    code: 'rate_limit_exceeded',
    message: 'Rate limit reached for gpt-4o in organization org-xxxxxxxxxxxxxxxxxxxxx on tokens per min (TPM): Limit 10000, Used 6630, Requested 3787. Please try again in 2.502s. 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: 'tokens'
}
SDDoSx · 1 year ago

issue still exist today, why is this closed?

d-fens2k · 1 year ago

Any news on this? Still heppening and makes Codex for me pretty unusable :(

Magowntown · 11 months ago

In August and this is still happening