Answer: For Codex CLI, pipe the key to `codex login` through stdin using `printenv OPENAI_API_KEY | codex login --with-api-key`. For the IDE extension, on the signed-out screen select **Use API Key**, enter your key, then select **OK**. Status: Confirmed Entry: tool/codex/account-and-plans/sign-in-api-key Revision: 1 Digest: sha256:b4589720359ee3a3 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:47:38Z Last changed: 2026-11-13T03:47:38Z Last verified: 2026-11-20T13:35:14Z Next check: 2026-11-21T13:35:14Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of CLI sign-in command | printenv OPENAI_API_KEY | codex login --with-api-key | [1] | 2026-11-20 IDE extension sign-in step | Use API Key | [1] | 2026-11-20 API key source | OpenAI dashboard | [1] | 2026-11-20 Sources: [1] OpenAI. "Authentication". https://learn.chatgpt.com/docs/auth.md Role: primary. Accessed: 2026-11-20T13:35:14Z Quote: "printenv OPENAI_API_KEY | codex login --with-api-key" (Supports: CLI sign-in command) Quote: "On the signed-out screen, select **Use API Key**, enter your key, then select" (Supports: IDE extension sign-in step) Quote: "Get your API key from the [OpenAI dashboard](https://platform.openai.com/api-keys)." (Supports: API key source) Snapshot SHA-256: 67d3f0c64897ea26b48e62a634ced7dbd2763a47104e12a0923cc528986de588 (captured 2026-11-13T03:47:37Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:47:38Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:35:14Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:35:14Z Last attempt: 2026-11-20T13:35:14Z Notes and limitations: Extracted automatically from a single official source (section "Sign in with an API key"). Related: https://latestn.com/tool/codex/account-and-plans/sign-in-chatgpt-codex-cli How do I sign in to Codex CLI with my ChatGPT account? https://latestn.com/tool/codex/account-and-plans/subagent-availability Which accounts and Codex clients support subagent workflows? https://latestn.com/tool/codex/account-and-plans/ultrafast-mode-plan-availability Which ChatGPT and Codex plans include GPT-6.1 Sol Ultrafast mode? https://latestn.com/tool/codex/account-and-plans/composer-predictions-requirements What do I need to use composer predictions in Codex? https://latestn.com/tool/codex/account-and-plans/linear-codex-plan-requirements What plans are required to use Codex in Linear, and what must Enterprise admins enable? https://latestn.com/tool/codex/account-and-plans/plans-including-security-review Which ChatGPT plans include Codex Security Review? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:47:38Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/account-and-plans/sign-in-api-key/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/codex/account-and-plans/sign-in-api-key POST: https://latestn.com/dispute/tool/codex/account-and-plans/sign-in-api-key with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/account-and-plans/sign-in-api-key?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I sign in to Codex CLI or the IDE extension using an API key? Revision 1, last verified 2026-11-20T13:35:14Z. https://latestn.com/tool/codex/account-and-plans/sign-in-api-key (accessed 2026-11-21T10:06:18Z). @misc{LatestN_tool_codex_account_and_plans_sign_in_api_key_r1, title = {How do I sign in to Codex CLI or the IDE extension using an API key?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/account-and-plans/sign-in-api-key}}, note = {Revision 1; digest sha256:b4589720359ee3a3; last verified 2026-11-20T13:35:14Z; accessed 2026-11-21T10:06:18Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/codex/account-and-plans/sign-in-api-key