OpenAI Codex
API key, ChatGPT subscription, or the installation AI proxy
OpenAI's coding agent, run on your own machines instead of OpenAI's sandbox. SAM installs it in your workspace, keeps its sign-in fresh across parallel sessions, and limits it to the tools your project gives it.
- GPT-6 Astra
- GPT-6.1 Sol
- GPT-6.1 Terra
- GPT-6 Luna
What you get
Three ways to pay
Your OpenAI API key, your ChatGPT subscription (guided sign-in with a one-time code), or the installation's AI proxy if your administrator turns it on.
Safe token refresh
SAM serializes ChatGPT token refresh per user, so parallel Codex sessions do not invalidate each other's sign-in.
Only the tools you give it
SAM turns off Codex's built-in apps and plugins, so a session has only the tools and skills from SAM, your project and your profile.
OpenAI-compatible endpoints
Point Codex at another OpenAI-compatible API through a custom base URL.


Set it up in 4 steps
-
Connect an account
In Settings → Agents, sign in with ChatGPT or paste an OpenAI API key.
-
Pick a profile
Choose Codex and a model in an agent profile.
-
Start a chat or task
SAM places the work on a machine, builds your devcontainer and starts Codex.
-
Review the result
Follow along in project chat and review the branch or pull request.
Good for
Bug triage in parallel
Turn several bug reports into tasks and let one Codex session investigate each.
Migrations
Framework upgrades, dependency bumps and language version changes, split across sessions.
Second opinion
Run Codex and Claude Code on the same task with different profiles and compare the branches.
Questions
Do I need a ChatGPT subscription?
No. You can use an OpenAI API key, a ChatGPT subscription, or the installation AI proxy if your administrator has enabled it.
Which models can I choose?
GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Sol, GPT-6 Luna and the GPT-5.6 models. A few older models work only with an API key.
Where does Codex run?
On a cloud VM, inside your repository's devcontainer, using a cloud account connected to your SAM installation. A profile can choose an Instant session on Cloudflare Containers instead, which needs no cloud account but does not use your devcontainer.
Related integrations
Get your coding agents off your laptop
SAM is open source. Deploy it to your Cloudflare account and connect your agent. Add a cloud provider when you want full environments on your own servers.