Adding a Codex account
Sign Codex in with ChatGPT and paste back the address your browser lands on, or give it an OpenAI API key. Once, for every Codex box in the organization.
- Reading time
- 2 min read
- Who
- Owner
How it works
Codex accounts sit beside the Claude accounts on Settings → AI and behave the same way. A Codex box runs on the organization's default Codex account; when one hits its usage limit or its login fails, the box moves to the next Codex account and re-sends what failed. A box never moves to the other agent's account.
There are two ways to add one:
- Sign in with ChatGPT. The normal ChatGPT sign-in, on your ChatGPT plan, with nothing to
switch on in ChatGPT first. The sign-in itself runs inside DevBench's own sign-in box, where
Codex waits for the answer at
localhost:1455; none of your workspaces needs to be running. When you finish signing in, ChatGPT sends your browser tohttp://localhost:1455/auth/callback?code=…, and on your own machine nothing is listening there, so the page fails to load. That is expected: the address is the answer. Paste it back into Settings and DevBench delivers it to the sign-in waiting in that box. - Use an API key. Paste an OpenAI API key. Usage is billed to that key's OpenAI account, and there is never anything to sign in to again.
Either way the login is stored encrypted and written into every Codex box on that account. A ChatGPT login is also refreshed centrally every hour and pushed to every box on it. Codex's refresh token works exactly once, so boxes left to refresh on their own would race for it and all but one would be signed out. Nobody has to sign in again unless the login is revoked.
Steps
Open Settings → AI and press Add a Codex account in the Codex section.
Choose Sign in with ChatGPT, optionally name the account, and press Start sign-in.
Press Sign in with ChatGPT ↗ and sign in as you normally would.
It opens in a new tab.
When the tab shows a page that cannot load, copy the whole address from the address bar.
It starts with
http://localhost:1455/auth/callback?code=and hasstate=in it.Paste it into Settings and press Submit.
The account appears with its email and plan, and every Codex box on it is signed in.
Or choose Use an API key, paste the key and press Add account.
Ready at once.
Press Make default on the account boxes should start on, and add a second one if you want failover.
Worth knowing
The OpenAI key further down the AI tab drafts requirements and nothing else. A Codex box never uses it; only a Codex account signs Codex in.
Paste the address the browser landed on, not the sign-in link you started from. Settings refuses anything that is not a
localhostcallback with acodeand astatein it.Signing an existing account in again starts from nothing on purpose: Codex's sign-in signs out whatever login it finds first, so it is never run beside a live copy. The account's boxes get the new login by themselves.