[BUG] Auth conflict: Both a token (CLAUDE_CODE_OAUTH_TOKEN) and an API key (apiKeyHelper) are set
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I'm logging in with my Claude account. When I start claude, I get the following warning:
⚠ Auth conflict: Both a token (CLAUDE_CODE_OAUTH_TOKEN) and an API key (apiKeyHelper) are set. This may
lead to unexpected behavior.
• Trying to use CLAUDE_CODE_OAUTH_TOKEN? Unset the apiKeyHelper setting.
• Trying to use apiKeyHelper? Unset the CLAUDE_CODE_OAUTH_TOKEN environment variable
If I continue to input anything, claude reports error
⎿ Invalid API key · Fix external API key
the `/status' shows
Account
L Auth Token: CLAUDE_CODE_OAUTH_TOKEN
L API Key: apiKeyHelper
I don’t have any Claude API key variable set in my environment. I checked the settings file at/Library/Application Support/ClaudeCode/managed-settings.json and found this entry:
"apiKeyHelper": "/usr/local/bin/claude_code/api-key-helper"
claude works if I remove the apiKeyHelper entry from the settings.
Also, the script at /usr/local/bin/claude_code/api-key-helper references /usr/local/bin/clicat, which doesn’t exist on my machine.
What Should Happen?
the claude should work without shows any warning or error message.
Error Messages/Logs
$ claude
⚠ Auth conflict: Both a token (CLAUDE_CODE_OAUTH_TOKEN) and an API key (apiKeyHelper) are set. This may
lead to unexpected behavior.
• Trying to use CLAUDE_CODE_OAUTH_TOKEN? Unset the apiKeyHelper setting.
• Trying to use apiKeyHelper? Unset the CLAUDE_CODE_OAUTH_TOKEN environment variable.
> test
⎿ Invalid API key · Fix external API key
$ claude --version
Error getting API key from apiKeyHelper (in settings or ~/.claude.json): apiKeyHelper did not return a valid value
1.0.72 (Claude Code)
Steps to Reproduce
- login with claude account
- run
claude
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
1.0.72 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗