Conflicting Authentications
Conflicting Authentications
If we have a mix of authentication methods present, Claude will warn us to logout because it won't be clear which API key will be consumed.
⚠ Auth conflict: Both a token (claude.ai) and an API key (/login managed key) are set. This may lead to unexpected behavior.
- Trying to use claude.ai? claude /logout
- Trying to use /login managed key? claude /logout to sign out of claude.ai.
Fix: /logout and check your environment variables.
Claude should also warn you if you are using an API key when you launch it: "Detected a custom API key in your environment" — shows the masked ANTHROPIC_API_KEY and asks "Do you want to use this API key?" (Yes / No — No is recommended).
Related: Status and Keys, Via API Key