auth.md +12 −2
26 26
27OpenAI bills API key usage through your OpenAI Platform account at standard API rates. See the [API pricing page](https://openai.com/api/pricing/).27OpenAI bills API key usage through your OpenAI Platform account at standard API rates. See the [API pricing page](https://openai.com/api/pricing/).
28 28
2929Recommendation is to use API key authentication for programmatic Codex CLI workflows (for example CI/CD jobs). Do not expose Codex execution in untrusted or publicly triggerable environments.Features that rely on ChatGPT credits, such as [fast mode](https://developers.openai.com/codex/speed), are
30available only when you sign in with ChatGPT. If you sign in with an API key,
31Codex uses standard API pricing instead.
32
33Recommendation is to use API key authentication for programmatic Codex CLI workflows (for example CI/CD jobs). Don't expose Codex execution in untrusted or public environments.
30 34
31## Secure your Codex cloud account35## Secure your Codex cloud account
32 36
85 89
86If the active credentials don't match the configured restrictions, Codex logs the user out and exits.90If the active credentials don't match the configured restrictions, Codex logs the user out and exits.
87 91
8892These settings are commonly applied via managed configuration rather than per-user setup. See [Managed configuration](https://developers.openai.com/codex/security#managed-configuration).These settings are commonly applied via managed configuration rather than per-user setup. See [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration).
89 93
90## Login on headless devices94## Login on headless devices
91 95
141docker cp ~/.codex/auth.json MY_CONTAINER:"$CONTAINER_HOME/.codex/auth.json"145docker cp ~/.codex/auth.json MY_CONTAINER:"$CONTAINER_HOME/.codex/auth.json"
142```146```
143 147
148For a more advanced version of this same pattern on trusted CI/CD runners, see
149[Maintain Codex account auth in CI/CD (advanced)](https://developers.openai.com/codex/auth/ci-cd-auth).
150That guide explains how to let Codex refresh `auth.json` during normal runs and
151then keep the updated file for the next job. API keys are still the recommended
152default for automation.
153
144### Fallback: Forward the localhost callback over SSH154### Fallback: Forward the localhost callback over SSH
145 155
146If you can forward ports between your local machine and the remote host, you can use the standard browser-based flow by tunneling Codex's local callback server (default `localhost:1455`).156If you can forward ports between your local machine and the remote host, you can use the standard browser-based flow by tunneling Codex's local callback server (default `localhost:1455`).