Skip to content

anthropic_api_key insufficient - misleading 'Credit balance is too low' error when Claude Code subscription required #1053

@danhumphrey

Description

@danhumphrey

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

  1. Create an API key on platform.claude.com with credits
  2. Add as ANTHROPIC_API_KEY GitHub secret
  3. Configure workflow with only anthropic_api_key input (as documented)
  4. 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

  1. README implies anthropic_api_key is sufficient — it is not, at least not without a Claude Code subscription
  2. 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
  3. claude_code_oauth_token is not clearly documented as the likely correct credential for most users
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationp2Non-showstopper bug or popular feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions