Anthropic API Authentication Token Expired

Resolved 💬 3 comments Opened Jul 16, 2025 by ejstembler Closed Jul 16, 2025

Bug Description
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."}}

Environment Info

  • Platform: darwin
  • Terminal: zed
  • Version: 1.0.53
  • Feedback ID: 0c6b189d-e3cb-4ae8-ad50-3e00ad63dac4

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:892:11)\n    at execSync (node:child_process:964:15)\n    at AI (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:728:6320)\n    at file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:16554\n    at Q (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:14406)\n    at MF (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:14339)\n    at zX (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:13205)\n    at MB (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:19174)","timestamp":"2025-07-16T03:44:40.274Z"},{"error":"Error: Command failed: security delete-generic-password -a $USER -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:892:11)\n    at execSync (node:child_process:964:15)\n    at AI (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:728:6320)\n    at EF0 (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:17666)\n    at KF0 (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:17540)\n    at h8A (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1763:2567)\n    at MB1.startOAuthFlow (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1763:3733)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-16T03:44:58.594Z"},{"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:892:11)\n    at execSync (node:child_process:964:15)\n    at AI (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:728:6320)\n    at file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:16554\n    at Q (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:14406)\n    at MF (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:14339)\n    at zX (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:13205)\n    at MB (file:///Users/ejstembler/.asdf/installs/nodejs/24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:19174)","timestamp":"2025-07-16T03:44:58.732Z"}]

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗