codex exec stopped working while TUI works
Resolved 💬 3 comments Opened Jan 9, 2026 by mjp0 Closed Jan 11, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
I don't know why but if I run codex, everything works but codex exec "say hi" returns ERROR: Quota exceeded. Check your plan and billing details.. My limits are at 100% in Codex usage dashboard, so everything should be good.
What could be causing this? Doesn't both codex and codex exec use the same ~/.codex/auth.json for authentication?
3 Comments
Yes,
codexandcodex execuse the sameauth.jsonfile, so something sounds amiss here.Here's an idea. Run
codexand/logout. Then runcodex loginand then go through the ChatGPT login flow. This should clear any cached auth details. Then trycodex exec. Does that fix it?I'd normally ask you to run
/feedbackto upload your logs, butcodex execdoesn't support/feedback.I figured this out finally. It was happening because I had
CODEX_API_KEYset with some dummy value from testing and looks likeexectries to use that first but TUI doesn't.