Hi everyone,
I ran into a confusing issue with Codex CLI and wanted to share my experience here.
What happened:
-
I logged in using “Log in with ChatGPT” thinking my subscription would cover everything
-
But Codex CLI found and used OPENAI_API_KEY from my project’s .env file. At first I thought it was using some fallback key, but it wasn’t - when I worked on my personal project, it used my personal API key from that .env file. When I worked on my company’s project, it used the company’s API key from that project’s .env file. I could see my Codex chat history showing up in the OpenAI Dashboard API logs for each project
-
This caused about $10 in unexpected API charges (only stopped because of my usage limit)
-
When I checked with
echo $OPENAI_API_KEYin the shell, it showed nothing, so I know I didn’t set it myself -
After upgrading Codex CLI to a newer version, this problem went away
I tried contacting support but it’s been really frustrating. They only gave me automated responses at first, and even when I got a human support person, they misunderstood my request and gave wrong answers. Now my emails are blocked.
I still don’t understand how my API keys got used without my permission even after I logged in with my ChatGPT Subscription. I just want to know why this happened and if I can get proper support for this issue.
I’m posting this so other developers know about this problem and maybe the product team will see it too.
My question: Is there a way to get this API charge removed or refunded? Has this happened to anyone else? (I searched the forum but there didn’t seem to be any posts exactly like my case)
Thanks for any help.