Skip to content

Rate limit reached for o4-mini #88

Closed

Description

@danielj86

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

Activity

  1. tibo-openai commented on Apr 16, 2025

    @tibo-openai
    Collaborator

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

  2. theabhinavdas commented on Apr 16, 2025

    @theabhinavdas
    Contributor

    @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
  3. tibo-openai commented on Apr 16, 2025

    @tibo-openai
    Collaborator

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

  4. danielj86 commented on Apr 16, 2025

    @danielj86
    Author

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

  5. danielj86 commented on Apr 16, 2025

    @danielj86
    Author

    @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

  6. tibo-openai commented on Apr 16, 2025

    @tibo-openai
    Collaborator

    Rudimentary fix in #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.

  7. tibo-openai commented on Apr 16, 2025

    @tibo-openai
    Collaborator

    Fix released 0.1.4161352

  8. beamdotdev commented on Apr 17, 2025

    @beamdotdev

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

  9. danielj86 commented on Apr 17, 2025

    @danielj86
    Author

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

  10. abhishek1234321 commented on Apr 19, 2025

    @abhishek1234321

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

  11. Philippe-Cohen commented on Apr 19, 2025

    @Philippe-Cohen

    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.

  12. mimoralea commented on Apr 20, 2025

    @mimoralea

    I just ran the Quickstart example:

    codex "explain this codebase to me"

    and hit the limit.

  13. WASasquatch commented on Apr 20, 2025

    @WASasquatch

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

  14. FINDINGDORYBRO commented on Apr 21, 2025

    @FINDINGDORYBRO

    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

  15. 3 remaining items

  16. codebrainz commented on Apr 22, 2025

    @codebrainz

    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.

  17. wbraswell commented on Apr 22, 2025

    @wbraswell
  18. averkij commented on Apr 22, 2025

    @averkij

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

  19. greggh commented on Apr 22, 2025

    @greggh

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

  20. ziadmoubayed commented on Apr 24, 2025

    @ziadmoubayed

    Still have the issue:

    codex --version
    0.1.2504172351
    
  21. SDDoSx commented on Apr 25, 2025

    @SDDoSx

    Still have the issue:

    codex --version
    0.1.2504172351
    

    on same version, also have the same issue still.

  22. webpolis commented on May 27, 2025

    @webpolis
    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.
  23. nccvector commented on May 31, 2025

    @nccvector

    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'
    }
    
    
  24. SDDoSx commented on Jun 2, 2025

    @SDDoSx

    issue still exist today, why is this closed?

  25. d-fens2k commented on Jul 7, 2025

    @d-fens2k

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

  26. Magowntown commented on Aug 14, 2025

    @Magowntown

    In August and this is still happening

  27. added a commit that references this issue on Sep 18, 2025
    9e535af
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions