How to set up Codex
Codex works in the Codex app, in your terminal and in your editor. Here's how to install it, sign in and get your first change done.
Codex is OpenAI's coding agent: a tool, sometimes called a harness, that connects OpenAI's GPT models to your project so they can read files, make edits and run commands to complete the tasks you describe. You can use it in the Codex app, in your terminal through the open-source Codex CLI, in an editor extension, or in the cloud. The GPT models run on OpenAI's servers, so the prompts and code Codex works with are sent to OpenAI. Here's how to set it up, using the commands from OpenAI's documentation.
What you need
- A ChatGPT account. Codex is included with ChatGPT Free, Go ($8 a month), Plus ($20), Pro (from $100), Business, Edu and Enterprise, with more usage on higher plans. Alternatively, an OpenAI API key, billed per use.
- For the CLI: macOS 12 or later, or a recent Linux (Ubuntu 20.04+, Debian 10+); 4 GB of memory minimum, 8 GB recommended. On Windows, there's a PowerShell installer, the Windows app and WSL2 support.
Prices as listed by OpenAI in November 2026.
Option A: the Codex app (no terminal)
OpenAI's Codex app is available for macOS, Windows and Linux. Install it, sign in with your ChatGPT account and start a task. This is the simplest route if you'd rather not use the command line.
Option B: the Codex CLI
Step 1: Install
| Method | Command |
|---|---|
| macOS, Linux | curl -fsSL https://chatgpt.com/codex/install.sh | sh |
| Windows PowerShell | powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" |
| Homebrew | brew install --cask codex |
| npm | npm install -g @openai/codex |
Step 2: Sign in
- Go to your project:
cd /path/to/your/project - Run
codexand choose Sign in with ChatGPT (or runcodex login). - To use an API key instead:
printenv OPENAI_API_KEY | codex login --with-api-key
Check your status with codex login status; sign out with codex logout.
Step 3: Your first task
Describe a small change, such as fixing a typo or adding a page. By default, in a folder under Git, Codex can edit files in your project and asks before doing anything beyond that; network access is off by default. Review its changes before keeping them.
Step 4: Choose a model
Type /model to pick the model and reasoning effort, or start with codex --model <name>. If you don't choose, Codex uses a recommended model.
Step 5: Add project instructions
Codex reads AGENTS.md files for project instructions, such as how to run tests and which conventions to follow.
Option C: your editor
OpenAI's extension works in VS Code, Cursor and Windsurf, and there are integrations for Xcode and JetBrains. Sign in with ChatGPT or an API key.
A visual workspace for Codex on Mac
Nexus is a native Mac app that uses the Codex app by OpenAI, with a sign-in of its own, and wraps it in a visual workspace: chat, live preview, diffs and a restore point after every finished task. You can switch to Claude Code by Anthropic or a free local model in the same chat. Nexus will be a one-time purchase of $199 USD, with no Nexus subscription; Codex uses your own ChatGPT plan. It's for Apple silicon Macs and is coming soon. More graphical options for Codex.
Frequently asked questions
Is Codex free?
Codex is included with ChatGPT plans, including Free and Go with limited usage. Plus ($20 a month) and Pro (from $100) include more. Codex Cloud isn't included with Free or Go.
Can I use Codex with an API key?
Yes. You can sign in with an OpenAI API key, billed at standard API rates instead of your ChatGPT allowance. Some cloud features need a ChatGPT sign-in.
Is Codex open source?
The Codex command-line tool is open source under the Apache 2.0 licence.