Skip to content

30k tokens per minute with Tier 1 API key #2629

Closed

Description

@ReyNeill

What version of Codex is running?

latest

Which model were you using?

gpt-5

What platform is your computer?

macOS

What steps can reproduce the bug?

  • Start any conversation with gpt-5 with an API key of a Tier 1 verified organization

Issue

It's literally impossible to use gpt-5 on the CLI with a Tier 1 account:

"🖐 stream disconnected before completion: Request too large for gpt-5 in organization org-IwwmbIkguifYieViu0oMJ8Uv on tokens per min (TPM):
Limit 30000, Requested 30237. The input or output tokens must be reduced in order to run successfully. Visit https://platform.openai.com/
account/rate-limits to learn more."

This MUST be unintended. If it's not, then how come a user need to consume tokens via API if it's not thinking GPT-5 (the objectively best and latest model). Plus pricing and efficiency of inference of gpt-5 being outstanding from OpenAI. I'm still paying for my tokens!

Maybe it was just never considered/revisited and rate-limit changes updates must be applied. Thanks for your attention to this matter.

Activity

  1. Wydoyolo commented on Aug 24, 2025

    @Wydoyolo

    Same issue, waiting 10 minutes just to see the tokens I paid for were not enough and need to start over praying this time my money won't be flushed in the toilet.

    Just to clarify: Even simple task "remove button XXX from YYYY.php file" is taking up 30000+ tokens.

  2. ReyNeill commented on Aug 24, 2025

    @ReyNeill
    Author

    I also received this response:

    Image

    And can confirm signing in via ChatGPT does not work based on API keys and rate limiting applies on subscription. There's a lot of potential new customers being lost because of this.

  3. ae-openai commented on Aug 24, 2025

    @ae-openai
    Contributor

    can you make sure you're on the latest version, then tell me what you see in /status after signing in with chatgpt on a plus/pro/team account? you shouldn't see that limit

  4. mrqs001 commented on Aug 24, 2025

    @mrqs001

    @ae-openai They want to use the API instead of subscription login, but since they created a new org they only have a Tier-1 API key. That means they’re limited to 30k tokens per minute and in turn limited to 30k in a single request
    Unless you have a Tier-3 or Tier-4 org, using Codex for coding is basically impossible.

  5. stef4ik commented on Aug 25, 2025

    @stef4ik

    Yes, i cant do the simplest task with codex as a tier one user. 30k tokens is just not enough

  6. changed the title [-]It's impossible to make a gpt-5 request for new organizations![/-] [+]30k tokens per minute with Tier 1 API key[/+] on Aug 25, 2025
  7. mdbro commented on Aug 25, 2025

    @mdbro

    > can you make sure you're on the latest version, then tell me what you see in /status after signing in with chatgpt on a plus/pro/team account? you shouldn't see that limit
    @ae-openai

    This is in regards to tier 1 organization API key usage (per the title of the issue), NOT for a plus/pro/team account.

    @ae-openai this has been an issue going back to at least April 16, 2025. At least a hundred users have repeatedly reported that Codex suddenly crashes when it exceeds organization-specific tokens-per-minute (TPM) limits (30,000 TPM for GPT‑5 for tier 1 organizations via the API) without retrying or preserving session context.

    There’s a long, long trail of rate-limit/crash reports. Nearly all are closed, often without clear remediation notes, and always with users reporting this has not been resolved: #88, #97, #137, #157, #233, #246, #303, #326, #334, #353, #451, #553, #690, #691, #1115, #2022, #2131, and #2448: When a tier 1 organization logs into Codex CLI via the API, Codex CLI crashes when hitting rate limits instead of honoring retry-after instructions or preserving session context. Every time, maintainers like @pakrym-oai have closed every single one of these issues without additional explanation, follow-up, or acknowledgment that the issue persists, despite continued user reports. Users have made the issue abundantly clear in the dozens of published issues, and the responses to maintainers like @pakrym-oai. I like to give the benefit of the doubt, but I am having trouble here understanding how this could be anything but gross negligence, unless this is a hidden policy choice from upper leadership that has purposefully been obscured from users.

    This pattern is deeply troubling and erodes trust. Trust not just in Codex CLI itself, but in the integrity of OpenAI’s support for its own developer tools. Could leadership clarify whether this is being actively addressed? Or what priorities or constraints are behind repeatedly closing unresolved issues? Confidence that the maintainers' decisions aren’t perceived as intentional dismissal or silent ignoring of legitimate user concerns is essential for developer's confidence in the platform.

    @ae-openai, we need explicit clarity and transparency on this.

    @tibo-openai
    @wojzaremba
    @codex-maintainers

    #2149

  8. digitalmagnets commented on Aug 25, 2025

    @digitalmagnets

    Started using Codex with API key and all I have been able to do is /init. Everything else is bailing out with request too large TPM limits. I was hoping Codex could be the answer to some problems I have had with a similar 'Code' competitor.

  9. adsqx commented on Aug 25, 2025

    @adsqx

    ⚠️ Problem: Context Bloat (aka Context Window Explosion) in Codex/LLMs

    Suppose each file has ~10k tokens.
    There are two possible patterns for how context grows:


    1. Sequential (linear cost)

    If you only load the current file (or a snapshot/summary of it) at each step:

    • File 1 → context = 10k, cumulative usage = 10k
    • File 2 → context = 10k, cumulative usage = 20k
    • File 3 → context = 10k, cumulative usage = 30k
    • File 4 → context = 10k, cumulative usage = 40k

    ➡️ Per query: constant 10k
    ➡️ Across queries: total = 10k·n → O(n)

    Therefore, when a model needs to analyze multiple files at once, it’s better to load all four in parallel to avoid duplication and then return a consolidated snapshot to the main context. If the max context limit is a concern, each file can be processed in a separate chat and the four snapshots merged afterward.

    Or you could use a side agent to read even 10 files of 100k tokens each, but do it iteratively by loading only the current 10k at a time and storing snapshots in the main context about where everything is located. In that case, even a 10k token window would be enough to read large files, and at the same time the token usage would drop dramatically.


    2. Cumulative (quadratic cost – Gauss triangle)

    If you always reload all previous files together with the new one:

    • File 1 → context = 10k, cumulative usage = 10k
    • File 2 → context = 20k (file1 + file2), cumulative usage = 10k + 20k = 30k
    • File 3 → context = 30k (file1 + file2 + file3), cumulative usage = 10k + 20k + 30k = 60k
    • File 4 → context = 40k, cumulative usage = 10k + 20k + 30k + 40k = 100k

    This likely explains the large discrepancy between cache tokens and fresh input tokens — caused by repeated reloading of previous context. In practice, only ~40k tokens were newly read, but the cache registers ~100k due to accumulated reuse.
    Maybe there's also an issue with the cache itself under the hood — like it keeps buffering the same stuff multiple times and falls into a Gauss triangle pattern.

    Linear loading scales linearly (~1M tokens for 100 files at 10k each), while cumulative reloading explodes quadratically (~50M tokens), the classic Gauss triangle effect.

    General formula:

    [
    tokens_{total}(n) = 10k \cdot (1+2+\dots+n) = 10k \cdot \frac{n(n+1)}{2}
    ]

    ➡️ Per query: grows linearly → O(n)
    ➡️ Across queries: grows quadratically → O(n²) (Gauss triangle)


    ✅ Better approach: Iterative Summarization + Retrieval

    • Instead of carrying entire files in context every time, generate summaries or snapshots per file.
    • At query time, only load the minimal, relevant snapshots into context.
    • Optionally, leverage auxiliary models for preprocessing/parallel retrieval to reduce main context usage.
    • Optionally, store embeddings in a small local vector DB (indexed).
      → Retrieve fragments on demand without quadratic token growth.

    Possible mitigations include: RAG (Retrieval Augmented Generation) for selective loading, hierarchical summarization (summary → detail on demand), and sliding windows to keep only the last N elements in context.

    💡 In practice:

    • If you design the pipeline well, you stay in the linear regime.
    • If you naïvely reload everything each time, you hit the quadratic Gauss triangle explosion.

    I guess the 30k limit comes precisely from this: during the agent era, such behavior from many users would overload the API, since even when you just write something short like ‘ok’ about 10 times, the client is still re-sending the same 200k tokens each time — which is easy to hit if you load entire files without any control.

    This isn’t a direct API fix, but a design pattern to avoid quadratic context explosion and use the token window efficiently. A real out-of-the-box solution would require changes in the overall Codex architecture — or designing your own agent from scratch.

    I’m not sure if I’ve chosen the right topic, but the above addresses the problem of exceeding the maximum context as well as the issue of the limit being used up too quickly on Plus and Pro accounts.

    PS. It seems like an incredible coincidence that the problem was suddenly found — and the excessive token counting turned out to be 7–9× higher than expected, of course 👎 :)

  10. snipeship commented on Aug 27, 2025

    @snipeship

    Likely related to #2697 , #2698 probably closes this issue

  11. adsqx commented on Aug 27, 2025

    @adsqx

    @snipeship
    Exactly the same thing with the assistant’s repeated message I noticed yesterday.

  12. snipeship commented on Aug 27, 2025

    @snipeship

    @snipeship
    Exactly the same thing with the assistant’s repeated message I noticed yesterday.

    Consider giving the issue & PR a thumbs up

  13. adsqx commented on Aug 27, 2025

    @adsqx

    I’ll try to sort something out if no one beats me to it :) I’m juggling a few projects at the moment, so we’ll see how it goes :)

  14. snipeship commented on Aug 27, 2025

    @snipeship

    I’ll try to sort something out if no one beats me to it :) I’m juggling a few projects at the moment, so we’ll see how it goes :)

    #2698 beat you to it

  15. 33 remaining items

  16. self-assigned this
    on Sep 11, 2025
  17. chausner commented on Sep 11, 2025

    @chausner

    I can confirm that the issues appear to be fixed. So far I haven't run into any token limits anymore. Thanks!

  18. pakrym-oai commented on Sep 11, 2025

    @pakrym-oai
    Contributor
  19. chconil commented on Sep 15, 2025

    @chconil

    @pakrym-oai Hi there, I just installed codex, have a TIER 1 API (for now) and it's not usable here. codex-cli 0.34.0

    ⚠️ stream error: stream disconnected before completion: Request too large for gpt-5 in organization org-u6GKV2iaOfeNIdalvq9Iw8fk on tokens per min (TPM):
    Limit 10000, Requested 14994. The input or output tokens must be reduced in order to run successfully. 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.;
    retrying 1/5 in 219ms…
    
    ⚠️ stream error: stream disconnected before completion: Request too large for gpt-5 in organization org-u6GKV2iaOfeNIdalvq9Iw8fk on tokens per min (TPM):
    Limit 10000, Requested 14994. The input or output tokens must be reduced in order to run successfully. 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.;
    retrying 2/5 in 418ms…
    
    ⚠️ stream error: stream disconnected before completion: Request too large for gpt-5 in organization org-u6GKV2iaOfeNIdalvq9Iw8fk on tokens per min (TPM):
    Limit 10000, Requested 14994. The input or output tokens must be reduced in order to run successfully. 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.;
    retrying 3/5 in 879ms…
    
    ⚠️ stream error: stream disconnected before completion: Request too large for gpt-5 in organization org-u6GKV2iaOfeNIdalvq9Iw8fk on tokens per min (TPM):
    Limit 10000, Requested 14994. The input or output tokens must be reduced in order to run successfully. 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.;
    retrying 4/5 in 1.718s…
    
    ⚠️ stream error: stream disconnected before completion: Rate limit reached for gpt-5 in organization org-u6GKV2iaOfeNIdalvq9Iw8fk on requests per min
    (RPM): Limit 500, Used 500, Requested 1. Please try again in 120ms. Visit https://platform.openai.com/account/rate-limits to learn more.; retrying 5/5
    in 120ms…
    
    
  20. pakrym-oai commented on Sep 15, 2025

    @pakrym-oai
    Contributor

    Are you using multiple codex sessions in parallel. 500RPM is pretty high.

  21. adsqx commented on Sep 15, 2025

    @adsqx

    ⚠️ stream error: stream disconnected before completion: Request too large for gpt-5 in organization org-u6GKV2iaOfeNIdalvq9Iw8fk on tokens per min (TPM):
    Limit 10000, Requested 14994. The input or output tokens must be reduced in order to run successfully. 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.;
    retrying 3/5 in 879ms…

    It looks like, for some reason, it has a limit of 10,000 instead of 500,000.

    Unless, in the current version, the limit counter gradually decreases.
    By the way, it's incredibly interesting how you managed to hit 500 RPM in a minute.

  22. necatituran commented on Sep 21, 2025

    @necatituran

    I'm getting this error, it started it yesterday. any hope for fix?

  23. makeable commented on Sep 23, 2025

    @makeable

    This is also causing problems for me. I run out of usage on ChatGPT, was told to use an API key, and now I get this. It seems it is impossible to do a continuation from ChatGPT unless you are already a heavy API user.

    stream disconnected before completion: Request too large for gpt-5-codex in organization org-XXXXXXXXXXX on tokens per min (TPM): Limit 30000, Requested 32680. The input or output tokens must be reduced in order to run successfully. Visit https://platform.openai.com/account/rate-limits to learn more.
    
  24. polycatenane commented on Nov 24, 2025

    @polycatenane

    gpt-5 and gpt-5-codex seem to be at 500k tpm but gpt-5.1 and gpt-5.1-codex are at 30k tpm for me. This seems like another oversight.

  25. ae-openai commented on Nov 24, 2025

    @ae-openai
    Contributor

    thanks for the flag. looking into it

  26. ae-openai commented on Nov 24, 2025

    @ae-openai
    Contributor

    @polycatenane this is fixed!

  27. tommedema commented on Feb 11, 2026

    @tommedema

    @ae-openai I'm getting this issue again with GPT-5.3-Codex:

    Error running remote compact task: unexpected status 413 Payload Too Large: <html> <head><title>413 Payload Too Large</title></head> <body> <center><h1>413 Payload Too Large</h1></center> <hr><center>cloudflare</center> </body> </html>, url: https://chatgpt.com/backend-api/codex/responses/compact, cf-ray: 9cbf9cf9dccce9e7-SJC
    
  28. etraut-openai commented on Feb 11, 2026

    @etraut-openai
    Contributor

    @tommedema, the issue described in this bug report was fixed months ago. If you're seeing a similar behavior, please use the /feedback command to upload your logs and session details, then open a new bug and include the thread ID in it. Thanks!

  29. locked as resolved and limited conversation to collaborators on Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authIssues related to authentication and accountsbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions