Clarification on OpenAI API Key for Codex CLI vs. ChatGPT Teams Account

Hey mate,

I ran into this too when I first tried using Codex CLI on Ubuntu. That “stream disconnected before completion error” usually pops up when there’s a problem with how the API key is set up or if the CLI can’t properly reach the OpenAI servers.

Just to clarify having a ChatGPT Teams account (even if it’s paid) doesn’t automatically give you access to the OpenAI API. They’re two separate things.

Codex CLI needs an API key from the OpenAI developer platform, not the key or credentials tied to your ChatGPT web account.

1 Like