Codex is included with ChatGPT Plus, Pro, Business, Edu, and Enterprise plans. Using Codex with your ChatGPT subscription gives you access to the latest Codex models and features.
You can also use Codex with API credits by signing in with an OpenAI API key.
Setup
Install the Codex extension for your IDE:
- Download for Visual Studio Code
- Download for Cursor
- Download for Windsurf
- Download for Visual Studio Code Insiders
Once installed, the Codex extension appears in the sidebar alongside your other extensions. It may be hidden in the collapsed section. You can move the Codex panel to the right side of the editor if you prefer.
Sign in with your ChatGPT account or API key to get started.
Codex starts in Agent mode by default, which lets it read files, run commands, and write changes in your project directory.
Codex can modify your codebase, so consider creating Git checkpoints before and after each task so you can easily revert changes if needed.
The Codex CLI is supported on macOS, Windows, and Linux.
Install with your preferred package manager:
# Install with npm
npm install -g @openai/codex# Install with Homebrew
brew install codexRun codex in your terminal to get started. You’ll be prompted to sign in with your ChatGPT account or an API key.
Once authenticated, you can ask Codex to perform tasks in the current directory.
Codex can modify your codebase, so consider creating Git checkpoints before and after each task so you can easily revert changes if needed.
To use Codex in the cloud, go to chatgpt.com/codex. You can also delegate a task to Codex by tagging @codex in a GitHub pull request comment (requires signing in to ChatGPT).
Before starting your first task, set up an environment for Codex. Open the environment settings at chatgpt.com/codex and follow the steps to connect a GitHub repository.
Once your environment is ready, launch coding tasks from the Codex interface. You can monitor progress in real time by viewing logs, or let tasks run in the background.
When a task completes, review the proposed changes in the diff view. You can iterate on the results or create a pull request directly in your GitHub repository.
Codex also provides a preview of the changes. You can accept the PR as is, or check out the branch locally to test the changes:
git fetch
git checkout <branch-name>