Answer: To remove an API key environment variable in Claude Code, use the method for your platform: on macOS/Linux temporarily run unset ANTHROPIC_API_KEY, on Windows CMD run set ANTHROPIC_API_KEY=, or on Windows PowerShell run Remove-Item Env:ANTHROPIC_API_KEY. For permanent removal, edit your config file or delete the variable from System Environment Variables settings. Status: Confirmed Entry: tool/claude-apps/settings/remove-api-key-env-var Revision: 1 Digest: sha256:a6bba1dfd0dcf322 (changes whenever the content changes) Timeline: Created: 2026-11-13T02:57:56Z Last changed: 2026-11-13T02:57:56Z Last verified: 2026-11-20T12:01:46Z Next check: 2026-11-21T12:01:46Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of macOS/Linux temporary removal | unset ANTHROPIC_API_KEY | [1] | 2026-11-20 macOS permanent removal | sed -i '' '/ANTHROPIC_API_KEY/d' ~/.zshrc | [1] | 2026-11-20 Linux permanent removal | sed -i '/ANTHROPIC_API_KEY/d' ~/.zshrc | [1] | 2026-11-20 Windows CMD removal | set ANTHROPIC_API_KEY= | [1] | 2026-11-20 Windows PowerShell removal | Remove-Item Env:ANTHROPIC_API_KEY | [1] | 2026-11-20 Windows permanent removal | Delete the variable from System Environment Variables settings. | [1] | 2026-11-20 Sources: [1] Anthropic. "Manage API key environment variables in Claude Code | Claude Help Center". https://support.claude.com/en/articles/12304248-manage-api-key-environment-variables-in-claude-code Role: primary. Accessed: 2026-11-20T12:01:46Z Quote: "macOS/Linux (temporary): unset ANTHROPIC_API_KEY" (Supports: macOS/Linux temporary removal) Quote: "macOS (permanent): # Remove from config file sed -i '' '/ANTHROPIC_API_KEY/d' ~/.zshrc" (Supports: macOS permanent removal) Quote: "Linux (permanent) sed -i '/ANTHROPIC_API_KEY/d' ~/.zshrc" (Supports: Linux permanent removal) Quote: "Windows CMD: set ANTHROPIC_API_KEY=" (Supports: Windows CMD removal) Quote: "Windows PowerShell: Remove-Item Env:ANTHROPIC_API_KEY" (Supports: Windows PowerShell removal) Quote: "Windows (permanent): Delete the variable from System Environment Variables settings." (Supports: Windows permanent removal) Snapshot SHA-256: af3fbf2948ddfa530414b7ea72d19ea408260f08497b5ad746f0aaaaffafce8a (captured 2026-11-18T11:58:18Z) 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-18T11:58:18Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:01:46Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:01:46Z Last attempt: 2026-11-20T12:01:46Z Notes and limitations: Extracted automatically from a single official source (section "Remove an API key environment variable"). Related: https://latestn.com/tool/claude-apps/settings/set-api-key-env-var-permanently How do I set an ANTHROPIC_API_KEY environment variable permanently for Claude Code? https://latestn.com/tool/claude-apps/settings/set-break-reminder How do I set a break reminder in Claude? https://latestn.com/tool/claude-apps/settings/set-default-effort-level How do I set the default effort level for new conversations in Claude? https://latestn.com/tool/claude-apps/settings/monitor-usage-settings Where can I monitor my Claude usage consumption? https://latestn.com/tool/claude-apps/settings/open-monthly-recap How do I open my monthly recap in Claude? https://latestn.com/tool/claude-apps/settings/rate-chats-setting-location Where is the Rate chats setting located in Claude organization settings? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T02:57:56Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-apps/settings/remove-api-key-env-var/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/claude-apps/settings/remove-api-key-env-var POST: https://latestn.com/dispute/tool/claude-apps/settings/remove-api-key-env-var with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-apps/settings/remove-api-key-env-var?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I remove an API key environment variable in Claude Code? Revision 1, last verified 2026-11-20T12:01:46Z. https://latestn.com/tool/claude-apps/settings/remove-api-key-env-var (accessed 2026-11-21T10:00:52Z). @misc{LatestN_tool_claude_apps_settings_remove_api_key_env_var_r1, title = {How do I remove an API key environment variable in Claude Code?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-apps/settings/remove-api-key-env-var}}, note = {Revision 1; digest sha256:a6bba1dfd0dcf322; last verified 2026-11-20T12:01:46Z; accessed 2026-11-21T10:00:52Z} } 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/claude-apps/settings/remove-api-key-env-var