[BUG] NO API KEY, API Billing occurring and draining my account

Resolved 💬 3 comments Opened May 9, 2026 by Huesdon Closed May 10, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

  • Claude Code version: 2.1.114
  • Platform: WSL2 Ubuntu on Windows 10
  • Subscription: Max (active)
  • ANTHROPIC_API_KEY: not set (echo "$ANTHROPIC_API_KEY" → empty)

## Credentials state (~/.claude/.credentials.json)

```json
{
"claudeAiOauth": {
"subscriptionType": "max",
"billingType": null,
"rateLimitTier": "default_claude_max_20x"
}
}

The bug report in #43333 explicitly shows billingType: "stripe_subscription". My account has billingType: null instead. /login
re-auth does not change this — fields stay identical after the OAuth flow completes.

Symptom

  • Mid-session, on a regular interactive turn (no -p, no automation), I got: Credit balance too low · Add funds:

https://platform.claude.com/settings/billing

  • I have systemd workers that drive tasks through claude -p headless. These appear to be charging against platform credits, not

the Max subscription.

  • Subscription session-cap and weekly-cap usage are nowhere near limits — usage is being deducted from API credits.

Steps to reproduce

  1. Be a Max subscriber whose ~/.claude/.credentials.json shows billingType: null (root cause unclear — fresh /login does not

populate it).

  1. With ANTHROPIC_API_KEY unset, run claude -p "say hi".
  2. Observe usage debits from platform.claude.com credits instead of the Max subscription's session quota.

Hypothesis

The fix shipped after #43333 likely conditions subscription routing on billingType == "stripe_subscription". Accounts where the
OAuth issuer returns billingType: null (this thread, possibly #9694, #32286) fall through to API billing because the discriminator
is missing, even though subscriptionType and rateLimitTier correctly identify the account as Max.

Two possible fixes:

  1. Backend: ensure the OAuth response always populates billingType for active subscribers.
  2. Client: route to subscription billing whenever subscriptionType ∈ {pro, max} and ANTHROPIC_API_KEY is unset, regardless of

billingType.

Related

  • #43333 (closed, "fixed now" 2026-04-08) — original claude -p OAuth → API billing bug
  • #9694 — stuck in API billing with no API key
  • #32286 — silent API billing despite active Max
  • #37686 — claude -p caused $1,800+ in two days for a Max user
  • #3040, #12352 — earlier instances of the same family

What Should Happen?

I should be able to use my sub to run claude -p

Error Messages/Logs

Steps to Reproduce

Come use my computer without an API key with agents -p and watch it tell you you cant because you have no API credits.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.114

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗