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_KEY GitHub secret
- Configure workflow with only
anthropic_api_key input (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_key is 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_token is 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_key only
- No
claude_code_oauth_token provided
Summary
Setting up
claude-code-action@v1with a validanthropic_api_key(fresh key, $30 USD balance on platform.claude.com) consistently fails with: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
ANTHROPIC_API_KEYGitHub secretanthropic_api_keyinput (as documented)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) withCredit balance is too low— no indication that the credential type is wrong.Root cause (inferred)
The action uses
@anthropic-ai/claude-agent-sdkwhich internally runs theclaudeCLI. That CLI checks for a Claude Code subscription, not just API access. A rawanthropic_api_keyfrom platform.claude.com is not sufficient without a linked Claude Code subscription.Additional pain points
anthropic_api_keyis sufficient — it is not, at least not without a Claude Code subscriptionclaude_code_oauth_tokenis not clearly documented as the likely correct credential for most usersEnvironment
anthropics/claude-code-action@v1anthropic_api_keyonlyclaude_code_oauth_tokenprovided