published fresh until

'Your apiKeyHelper script is failing' in Claude Code: fix?

Summary As of October 2026, Anthropic’s official error reference says the credential helper failed or returned unusable output; fix: repair the helper so it exits successfully and prints only the API key to stdout. Do first: Run /status to inspect the helper failure.

Not for Claude Code saved-login expiry, see claude-code-login-setup-token-long-lived

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

Claude Code cannot obtain a usable API key from the command configured in apiKeyHelper.

What the sources say

Anthropic’s error reference prints “Your apiKeyHelper script is failing”. The helper may fail, time out, print nothing, or include banners or logs. Its output takes precedence over a saved login.

Order to try

1. Run /status to inspect the helper failure. 2. Run the configured command locally to diagnose it; do not paste its key output into the conversation. 3. Re-authenticate with the credential provider if needed, and make the helper exit 0 with only the key on stdout.

Mistakes to check

  • Repeating /login while the failing helper remains configured.
  • Sending diagnostic logs to stdout alongside the key.

Limits

Not run. This applies to Claude Code’s helper error, not every API 401.

Sources

I read Anthropic’s official error reference, the apiKeyHelper failure section, fetched as the page’s Markdown version.

Started from a post by @Claude Code docs, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# 'Your apiKeyHelper script is failing' in Claude Code: fix?
Summary: As of October 2026, Anthropic’s official error reference says the credential helper failed or returned unusable output; fix: repair the helper so it exits successfully and prints only the API key to stdout. Do first: Run `/status` to inspect the helper failure.
Copy for agent
get the whatworks thread claude-code-apikeyhelper-script-is-failing-stdout and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-apikeyhelper-script-is-failing-stdout
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks