In short.
This documentation page explains how individual developers, automation builders and workspace administrators sign in to Codex, the coding agent in the ChatGPT desktop app, Codex CLI and IDE extension, and how to choose among the sign-in methods. Each method carries different access, billing and data-handling rules. It explains browser login, device-code authentication, API keys, Enterprise access tokens, credential caching, managed restrictions and custom providers. Its practical value is connecting those choices to local work, cloud access and trusted automation. No commands or authentication flows were run, and exact prices, minimum versions and complete feature eligibility remain unknown.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is the complete page at [https://learn.chatgpt.com/docs/auth.md], including all supplied surface-specific sections, enterprise access tokens, MFA guidance, credential-storage notices, managed restrictions, diagnostics, certificate settings, headless fallbacks and alternative-provider authentication. Linked pages, including pricing, access-token administration, advanced CI/CD, gateway setup and external MFA instructions, are excluded. No commands, login flows, transfers or configurations were executed. Runtime behavior, exact prices, full plan eligibility, licensing and version compatibility remain unknown or unassessed where the page does not establish them.
The overview
Identity
Authentication is a documentation guide at [https://learn.chatgpt.com/docs/auth.md]. It teaches authentication for Codex in the ChatGPT desktop app, CLI and IDE extension, with additional guidance for ChatGPT web, Codex cloud and Work Cloud local computer access. The resource is instructional documentation rather than installable software.
Assessment
The guide is useful when deciding how to authenticate a local coding session, configure a private automation runner or enforce workspace login rules. It explains consequences beyond getting signed in: which account pays, which organization controls data handling and which features need ChatGPT workspace access.
It provides concrete commands and configuration names, but several decisions depend on linked documentation, including detailed plan availability, gateway requirements and enterprise token administration. Those details are not established by this page alone.
Users
Individual developers can use the desktop, CLI and IDE instructions. Automation developers get guidance for API keys and Enterprise access tokens. Workspace administrators get information about enforced login methods, workspace restrictions and credential storage. Developers using remote machines, containers or corporate networks also get headless-login and certificate guidance.
Capabilities
The page documents ChatGPT and API-key sign-in for local work, authentication-status checks and sign-out. It also describes Enterprise access tokens for trusted non-interactive workflows that need ChatGPT workspace entitlements or controls.
Operational guidance includes credential-store selection, automatic refresh of ChatGPT session tokens, login-specific logs, custom certificate bundles, device-code authentication and SSH callback forwarding. Custom providers have separate options for OpenAI authentication, environment-variable keys, gateway OAuth, credential helpers and local models without authentication.
Using it
Requirements
Local OpenAI-model access requires an appropriate ChatGPT account or Platform API key. Codex cloud requires ChatGPT sign-in. Enterprise access tokens require a ChatGPT Enterprise workspace and an administrator-granted permission. Device-code login must be enabled in personal security settings or workspace permissions.
Work Cloud local computer access separately requires ChatGPT sign-in to an eligible workspace, owner-enabled Work Cloud and Allow local computer access. API keys and Codex access tokens do not enable that feature.
For Codex cloud, the page requires MFA when an account supports email-and-password login, even if another sign-in method is used. It directs social-login users to their identity provider and SSO administrators to enforce MFA. Minimum client versions and a supported-operating-system matrix are not given.
Mechanism
ChatGPT sign-in opens a browser and returns credentials to the local client. Cached credentials are reused, and ChatGPT session tokens are refreshed automatically during use. The CLI and IDE extension share cached login details, so logging out through either requires signing in again for subsequent use of either client.
ChatGPT authentication follows workspace permissions, role-based access controls and applicable Enterprise retention and residency settings. API-key authentication instead follows the API organization's retention and data-sharing settings.
Cached credentials can reside in a plaintext auth.json file or an operating-system credential store. Configuration can request file storage, a required OS store, automatic OS-store selection with file fallback, or memory-only storage for the current process.
Setup
For interactive CLI access, the documented starting command is codex login, followed by browser sign-in. The desktop app and IDE extension expose sign-in choices on their signed-out screens. API-key access requires a key from [https://platform.openai.com/api-keys].
The cli_auth_credentials_store setting controls credential persistence. Choosing keyring fails if the operating-system store is unavailable; auto can fall back to a plaintext file. Administrators can enforce credential-storage requirements and configure forced_login_method or forced_chatgpt_workspace_id. Credentials that conflict with login restrictions cause Codex to log out and exit.
For corporate TLS proxies or private certificate authorities, the page documents CODEX_CA_CERTIFICATE pointing to a PEM bundle, with SSL_CERT_FILE as the fallback. It says these settings apply to login, HTTPS requests and secure WebSocket connections.
Example
For a private automation environment where OPENAI_API_KEY already contains a valid key, the guide supplies printenv OPENAI_API_KEY | codex login --with-api-key. The separate command codex login status reports the active authentication method. This illustrates the API-key route recommended for programmatic CLI work; the commands were not executed and no successful login is demonstrated.
Assessment & evidence
Limitations
API-key authentication does not provide every ChatGPT workspace or cloud feature. The page says supported OpenAI-curated plugins are available with API-key authentication in the CLI and desktop app, while some plugins are unavailable because their connection flows require unsupported OAuth capabilities. It does not enumerate those plugins.
Device-code authentication is marked beta. Copying auth.json may not apply when credentials are stored only in an operating-system credential store. The CLI also rejects login and logout commands when workload identity is selected by the process environment, but this page does not explain workload-identity setup.
Login success, refresh behavior, platform compatibility and configuration enforcement were not tested. The page supplies instructions rather than execution evidence.
Reasoning
The documented boundaries suggest ChatGPT sign-in for work that needs ChatGPT workspace access or Codex cloud, and API keys for metered local work and general programmatic CLI jobs. Enterprise access tokens address the narrower case of trusted automation needing ChatGPT-managed entitlements or enterprise controls. These are fit judgments based on the stated access rules; the page does not establish a universally cheapest or most capable choice.
Alternatives
For headless or remote machines, the page prefers device-code authentication, completed through a browser using a one-time code. Fallbacks include transferring the sensitive auth cache or forwarding the browser callback over SSH; the page gives the default local callback server as localhost:1455.
For custom providers, alternatives include OpenAI authentication, a provider key named through env_key, native gateway OAuth and a command-backed credential helper. Setting requires_openai_auth = true makes Codex ignore env_key. A local model requiring no credentials can omit authentication settings. The page does not compare other coding assistants or establish the compatibility of particular third-party providers.
Evidence
The source is the complete Authentication page at [https://learn.chatgpt.com/docs/auth.md]. It contains explanatory text, CLI examples and configuration examples. Linked pricing, enterprise, provider, configuration and MFA pages are separate sources whose contents are not included.
The captured source revision is sha256:67d3f0c64897ea26b48e62a634ced7dbd2763a47104e12a0923cc528986de588. The page provides no execution logs, measured reliability results or compatibility test results.
Access & freshness
Costs
The page distinguishes ChatGPT subscription access from usage-based API access. API-key activity is billed through the OpenAI Platform account at standard API rates rather than using included ChatGPT plan credits.
Exact subscription prices, API rates, allowances and workload costs are unknown from this page. It links to [https://openai.com/api/pricing/] and a separate feature-availability page, but their contents are outside this resource's scope.
Rights
The page contains no explicit license or redistribution grant for its documentation and examples. Reuse and redistribution rights are therefore unknown from this source. Authentication permissions describe product access, not permission to republish the guide.
Freshness
The documentation snapshot was captured on 2026-11-14 at 03:24:28.282 UTC. The page supplies no publication date, last-update date or applicable Codex version. Its beta label for device-code authentication is relevant when planning deployment, but the capture date alone does not establish ongoing compatibility.
Actions
Start by identifying whether the work needs local access, Codex cloud, Work Cloud local computer access or enterprise automation. Match that need to the documented authentication method, then consult the linked plan and workspace-permission pages for eligibility that this guide leaves unspecified.
Choose credential storage deliberately, use codex login status to inspect the active method and treat auth.json as a password because it contains access tokens. For headless ChatGPT login, begin with the documented device-code option. For troubleshooting, the guide points to codex-login.log under the configured log directory. Keep automation on trusted runners, as the page advises.
