anthropics / anthropics/claude-code-action

anthropics/claude-code-action@beta incorrectly reports billing/spending limit error despite working API key

Open
#213 1 comment 0 reactions 0 assignees View on GitHub
bug p2
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Bug Report for Anthropic GitHub Action

Issue Title:

anthropics/claude-code-action@beta incorrectly reports billing/spending limit error despite working API key

Bug Description:

The anthropics/claude-code-action@beta consistently fails with a billing error message, despite:
- Using a valid API key from an account with no billing issues
- Anthropic Console showing no rate limit events
- The same API key working fine in other contexts (Claude Code CLI)

Error Message:

The job was not started because recent account payments have failed or your spending limit needs to be increased. Please check the 'Billing & plans' section in your settings

Environment:

- Repository: cjbuchanan/blue_compass
- GitHub Action: anthropics/claude-code-action@beta
- Workflow: Claude Code Review
- Runner: ubuntu-latest
- Secret: ANTHROPIC_API_KEY (confirmed valid)

Workflow Configuration:

name: Claude Code Review

on:
pull_request:
types: [opened, synchronize]

jobs:
claude-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Claude Code Review
uses: anthropics/claude-code-action@beta
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
model: "claude-sonnet-4-20250514"
direct_prompt: |
Please provide a brief code review focusing on:
- Code quality and potential bugs
- Security concerns
- Best practices

Failed Runs:

- Run #81: https://github.com/cjbuchanan/blue_compass/actions/runs/15947368579
- Multiple previous runs with identical error
- Pattern: Job fails before any steps execute (at job initialization level)

Verification Steps Taken:

1. ✅ API Key Verified: Same key works in Claude Code CLI
2. ✅ Console Checked: No billing issues or rate limits in Anthropic Console
3. ✅ Secret Configured: ANTHROPIC_API_KEY properly set in repository secrets
4. ✅ Permissions: Repository has Actions enabled with "all" actions allowed
5. ✅ Models Tested: Tried both default and explicit model specifications
6. ✅ Prompt Simplified: Reduced token usage to minimal test case

Expected Behavior:

The GitHub Action should successfully authenticate and provide code review using the valid API key.

Actual Behavior:

The job fails immediately with billing error before executing any workflow steps.

Additional Context:

- This appears to be a false positive in the Action's billing detection
- The error occurs at the GitHub Actions job level, not within Action steps
- Same configuration worked in other repositories/contexts
- Issue persists across multiple workflow runs and configuration changes

Impact:

Unable to use automated Claude code reviews despite having valid Anthropic account and API access.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.