Sign in with your ChatGPT account

getting started

// what it does

codex login opens a browser, you sign in, and the credentials return to Codex — this uses your ChatGPT subscription, which includes Codex on Plus, Pro, Business, Edu, and Enterprise plans. On a headless box or over SSH where no browser is available, codex login --device-auth prints a code you approve on another device. Credentials cache at ~/.codex/auth.json.

// shell

$ codex login
$ codex login --device-auth

// gotcha

The default browser flow can't complete over SSH or in a container — use --device-auth there. Treat ~/.codex/auth.json like a password: it holds access tokens, so never commit or paste it.

// resources