Answer: Claude Code prioritizes environment variable API keys over authenticated subscriptions. When an API key is set as an environment variable, you'll be charged via API pay-as-you-go rates using the API account associated with that key, even if you're logged in with a claude.ai subscription or a different Console account. Status: Confirmed Entry: tool/claude-apps/account-and-plans/api-key-vs-subscription-priority Revision: 2 Digest: sha256:7f58b160ac6f6aca (changes whenever the content changes) Timeline: Created: 2026-11-13T02:57:56Z Last changed: 2026-11-19T11:58:23Z (applies despite subscription: — → even if you're logged into Claude Code with a claude.ai subscription or a different Console account) Last verified: 2026-11-20T12:01:47Z Next check: 2026-11-21T12:01:47Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of priority | prioritizes environment variable API keys over authenticated subscriptions | [1] | 2026-11-20 billing | charged via API pay-as-you-go rates | [1] | 2026-11-20 applies despite subscription | even if you're logged into Claude Code with a claude.ai subscription or a different Console account | [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:47Z Quote: "Claude Code prioritizes environment variable API keys over authenticated subscriptions." (Supports: priority) Quote: "you'll be charged via API pay-as-you-go rates using the API account associated with that key" (Supports: billing) Quote: "This happens even if you're logged into Claude Code with a claude.ai subscription or a different Console account." (Supports: applies despite subscription) 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:19Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:01:47Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:01:47Z Last attempt: 2026-11-20T12:01:47Z Notes and limitations: Extracted automatically from a single official source (section "How authentication works"). Related: https://latestn.com/tool/claude-apps/account-and-plans/app-store-subscribers-promotions Can App Store subscribers use Claude promotions? https://latestn.com/tool/claude-apps/account-and-plans/appeal-banned-account How do I appeal a banned Claude account? https://latestn.com/tool/claude-apps/account-and-plans/artifact-sharing-plans Which Claude plans support sharing artifacts with anyone who has the link? https://latestn.com/tool/claude-apps/account-and-plans/age-requirement What is the minimum age requirement to use Claude? https://latestn.com/tool/claude-apps/account-and-plans/ai-for-science-application-review How are applications to Anthropic's AI for Science Program evaluated? https://latestn.com/tool/claude-apps/account-and-plans/api-individual-use Can individuals or hobbyists use the Claude API for personal use? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T11:58:23Z | changed | applies despite subscription: — → even if you're logged into Claude Code with a claude.ai subscription or a different Console account | [1] 2026-11-19T11:58:23Z | changed | billing: — → charged via API pay-as-you-go rates | [1] 2026-11-19T11:58:23Z | changed | priority: — → prioritizes environment variable API keys over authenticated subscriptions | [1] 2026-11-19T11:58:23Z | changed | Applies despite subscription: even if you're logged into Claude Code with a claude.ai subscription or a different Console account → — | [1] 2026-11-19T11:58:23Z | changed | Billing: charged via API pay-as-you-go rates → — | [1] 2026-11-19T11:58:23Z | changed | Priority: prioritizes environment variable API keys over authenticated subscriptions → — | [1] 2026-11-13T02:57:56Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-apps/account-and-plans/api-key-vs-subscription-priority/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/account-and-plans/api-key-vs-subscription-priority POST: https://latestn.com/dispute/tool/claude-apps/account-and-plans/api-key-vs-subscription-priority with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-apps/account-and-plans/api-key-vs-subscription-priority?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How does Claude Code prioritize API key environment variables versus a Claude subscription? Revision 2, last verified 2026-11-20T12:01:47Z. https://latestn.com/tool/claude-apps/account-and-plans/api-key-vs-subscription-priority (accessed 2026-11-21T10:06:02Z). @misc{LatestN_tool_claude_apps_account_and_plans_api_key_vs_subscription_priority_r2, title = {How does Claude Code prioritize API key environment variables versus a Claude subscription?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-apps/account-and-plans/api-key-vs-subscription-priority}}, note = {Revision 2; digest sha256:7f58b160ac6f6aca; last verified 2026-11-20T12:01:47Z; accessed 2026-11-21T10:06:02Z} } 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/account-and-plans/api-key-vs-subscription-priority