-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Summary
Setting up claude-code-action@v1 with a valid anthropic_api_key (fresh key, $30 USD balance on platform.claude.com) consistently fails with:
Claude Code returned an error result: Credit balance is too low
The error is misleading — the real issue is that the action requires a Claude Code subscription or OAuth token, not just API credits.
Steps to reproduce
- Create an API key on platform.claude.com with credits
- Add as
ANTHROPIC_API_KEYGitHub secret - Configure workflow with only
anthropic_api_keyinput (as documented) - Trigger PR review
Expected behaviour
Either works correctly, or fails with a clear error explaining that a Claude Code subscription/OAuth token is required.
Actual behaviour
Fails instantly (duration_ms: 180, total_cost_usd: 0) with Credit balance is too low — no indication that the credential type is wrong.
Root cause (inferred)
The action uses @anthropic-ai/claude-agent-sdk which internally runs the claude CLI. That CLI checks for a Claude Code subscription, not just API access. A raw anthropic_api_key from platform.claude.com is not sufficient without a linked Claude Code subscription.
Additional pain points
- README implies
anthropic_api_keyis sufficient — it is not, at least not without a Claude Code subscription - console.anthropic.com redirects to platform.claude.com with no indication this is a separate billing system from claude.ai subscriptions — developers with a Max plan have no reason to know a second account with separate credits is needed
claude_code_oauth_tokenis not clearly documented as the likely correct credential for most users- The billing separation between claude.ai and platform.claude.com is not mentioned anywhere in the action docs
Environment
anthropics/claude-code-action@v1- GitHub Actions, ubuntu-latest
- Auth method:
anthropic_api_keyonly - No
claude_code_oauth_tokenprovided