Network error
Codex runs, but only responds with a network error message. I can connect to ChatGPT.com and talk to o4-mini without any problems, and if I change my OPENAI_API_KEY to something invalid I get a very different error message. The message below isn't very informative, though. Any idea why it's not working?
I'm running Ubuntu 20.04, have 128Gb of RAM (mostly free), and NodeJs v22.14.0.
╭──────────────────────────────────────────────────────────────╮
│ ● OpenAI Codex (research preview) v0.1.04161006 │
╰──────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────╮
│ localhost session: 21349ad9a2974d4d9908f251feed32c5 │
│ ↳ workdir: ~/xri/gates/src │
│ ↳ model: o4-mini │
│ ↳ approval: suggest │
╰──────────────────────────────────────────────────────────────╯
user
test
system
⚠️ Network error while contacting OpenAI. Please check your connection and try again.
╭──────────────────────────────────────────────────────────────╮
│ send a message │
╰──────────────────────────────────────────────────────────────╯
send q or ctrl+c to exit | send "/clear" to reset | send "/help" for commands | press enter to send
9 Comments
We are looking at this 👀
Oops, my bad. On the web page, I misread 4o-mini as o4-mini. I need to upgrade my API access to talk to o4-mini, but I can at least run codex against 4o-mini (which is probably a recipe for disaster). Some improvements to the error message might be nice, but otherwise, problem solved!
Still getting the error, whaere exactly did you change this?
I'm also hitting this error. I'm able to CURL the api from my WSL session and get a successful response. I think I had an incorrect model set initially, but just set it as the same model my buddy is running and still hitting "⚠️ Network error while contacting OpenAI. Please check your connection and try again."
Built it locally and it's able to connect using git bash 🤷♂️
It seems using the default model (o4-mini) doesn't actually work. After going to the dashboard and enabling o4-mini access (which HR did; I'm not sure what the dashboard actually looks like), the trick was to run with:
codex -m o4-mini-2025-04-16
With those two changes, it works like a charm!
I'm having this issue, i'm wondering if i need to setup any proxy or ssl cert from my end. I also tried
codex -m o4-mini-2025-04-16need to pass
httpAgentargument to OpenAI instance constructor