Answer: There are three common causes: the key was exported in a different shell (check with echo $ANTHROPIC_API_KEY), Claude Code has not yet been told to trust this key (it prompts once on first use), or the key is a Console key but your organization requires SSO login instead. Status: Confirmed Entry: tool/claude-apps/troubleshooting/not-authenticated-with-api-key Revision: 1 Digest: sha256:adc30e5400c0a1e8 (changes whenever the content changes) Timeline: Created: 2026-11-13T02:59:32Z Last changed: 2026-11-13T02:59:32Z Last verified: 2026-11-20T12:06:38Z Next check: 2026-11-21T12:06:38Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Cause 1 | the key was exported in a different shell | [1] | 2026-11-20 Check command | echo $ANTHROPIC_API_KEY | [1] | 2026-11-20 Cause 2 | Claude Code has not yet been told to trust this key | [1] | 2026-11-20 Cause 3 | the key is a Console key but your organization requires SSO login instead | [1] | 2026-11-20 Sources: [1] Anthropic. "Troubleshoot Claude Code installation and authentication | Claude Help Center". https://support.claude.com/en/articles/14552646-troubleshoot-claude-code-installation-and-authentication Role: primary. Accessed: 2026-11-20T12:06:38Z Quote: "the key was exported in a different shell (run echo $ANTHROPIC_API_KEY to check)" (Supports: Cause 1) Quote: "run echo $ANTHROPIC_API_KEY to check" (Supports: Check command) Quote: "Claude Code has not yet been told to trust this key (it prompts once on first use" (Supports: Cause 2) Quote: "the key is a Console key but your organization requires SSO login instead" (Supports: Cause 3) Snapshot SHA-256: 227030c02758d6da09e5faaf3fc434087980b419662f28929f3938537e4d65b3 (captured 2026-11-17T12:08:50Z) 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-17T12:08:53Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:06:38Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:06:38Z Last attempt: 2026-11-20T12:06:38Z Notes and limitations: Extracted automatically from a single official source (section "8. "Not authenticated" even though you set ANTHROPIC_API_KEY ."). Related: https://latestn.com/tool/claude-apps/troubleshooting/npm-eacces-permission-denied How do I fix EACCES or permission denied errors when running npm install for Claude Code? https://latestn.com/tool/claude-apps/troubleshooting/okta-sso-scim-email-mismatch-fix How do I fix an Okta SSO/SCIM email mismatch in Claude? https://latestn.com/tool/claude-apps/troubleshooting/onelogin-sso-scim-email-mismatch-cause Why does OneLogin SSO login to Claude fail with an email mismatch or blocked account creation? https://latestn.com/tool/claude-apps/troubleshooting/microsoft-365-connector-limitations What are the current limitations of the Claude Microsoft 365 connector? https://latestn.com/tool/claude-apps/troubleshooting/missing-verification-code What should I do if I didn't receive my Claude phone verification code? https://latestn.com/tool/claude-apps/troubleshooting/node-version-not-supported How do I fix 'Node version not supported' or a silent crash when launching Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T02:59:32Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-apps/troubleshooting/not-authenticated-with-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/claude-apps/troubleshooting/not-authenticated-with-api-key POST: https://latestn.com/dispute/tool/claude-apps/troubleshooting/not-authenticated-with-api-key with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-apps/troubleshooting/not-authenticated-with-api-key?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I fix 'Not authenticated' in Claude Code even though I set ANTHROPIC_API_KEY? Revision 1, last verified 2026-11-20T12:06:38Z. https://latestn.com/tool/claude-apps/troubleshooting/not-authenticated-with-api-key (accessed 2026-11-21T10:02:25Z). @misc{LatestN_tool_claude_apps_troubleshooting_not_authenticated_with_api_key_r1, title = {How do I fix 'Not authenticated' in Claude Code even though I set ANTHROPIC_API_KEY?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-apps/troubleshooting/not-authenticated-with-api-key}}, note = {Revision 1; digest sha256:adc30e5400c0a1e8; last verified 2026-11-20T12:06:38Z; accessed 2026-11-21T10:02:25Z} } 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/troubleshooting/not-authenticated-with-api-key