feat: don't close program when out of credits or when API key is missing
Resolved 💬 8 comments Opened Apr 16, 2025 by jayshrivastava Closed Aug 7, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
Current behavior
Program exits with an error when OPENAI_API_KEY is missing, when I have insufficient_quota, rate_limit_exceeded or when my org isn't verified to use certain models. This happens after my first prompt.
Desired
It would be nice to keep the program open and print an error to the user when this happens.
8 Comments
I believe there is an error printed and then the program exits? What would be the benefit of keeping
codexrunning after hitting a fatal error that prevents it from doing anything useful in this case?Would the program would lose the work that it started if it hits
insufficient_quotain the middle of execution?It think it does. I just a
rate_limit_exceededand I couldn't continue bc the program exited.Yes, if there was a way to not lose all the progress when you hit the rate limit, that would be great. I had a few issues with that this afternoon.
We've pushed improvements for when rate limits are encountered. More to come.
You often run out of credits when deep down a rabbit hole, so being able to present a link to the user to go fill up their balance and then continue is a good UX.
Otherwise you lose all the context you've built up and have to start from scratch, which is a "walk away from using the product" moment at least for that sesssion.
I run into this screen many times in Claude code bc I load like $25 at a time, and the url prompt to go pay them more money works every single time.
See also:
Thanks for the feedback! Please try again on the latest version of Codex CLI. If the issue persists, feel free to open a new issue or contribute to the
codex-rs/implementation.