Claude Code used my API key instead of my Max plan
Resolved 💬 8 comments Opened Jun 7, 2025 by dimfeld Closed Jan 7, 2026
Bug Description
I'm on a Max plan, but Claude incorrectly used my API key in a session and used almost $14 of usage on my API account.
I didn't see any indication that this was the case until it failed when the credits ran out. This was from the same terminal session which I had been using Claude Code earlier with no issues.
Environment Info
- Platform: macos
- Terminal: WezTerm
- Version: 1.0.17
- Feedback ID: 28428bb0-1783-46d2-95da-b6a1df7a485f
Errors
[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:882:11)\n at execSync (node:child_process:954:15)\n at YZ (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:654:3921)\n at file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:582:11794\n at Q (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:526:17190)\n at cJ (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:582:10940)\n at aP (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:582:10021)\n at a6 (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:582:14133)","timestamp":"2025-06-07T05:32:59.038Z"},{"error":"Error: No logs found at /Users/dimfeld/Library/Caches/claude-cli-nodejs/-Users-dimfeld-Documents-projects-llmutils/messages\n at eT4 (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:583:3738)\n at rQ1 (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:583:3487)\n at SAA.<anonymous> (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:2339:2076)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async SAA.parseAsync (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:517:4184)\n at async xE5 (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:2342:5983)\n at async yE5 (file:///Users/dimfeld/.pnpm/5/.pnpm/@anthropic-ai+claude-code@1.0.17/node_modules/@anthropic-ai/claude-code/cli.js:2338:19257)","timestamp":"2025-06-07T05:32:59.768Z"}]This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗