Skip to content

Anthropic API-key requests fail with "credit balance too low" when the org uses Claude Max/Team API credits #995

Closed

Description

@jhk0317

What happened?

My Anthropic Console org gets the monthly API credits included with Claude Max (~$97 promotional balance, $0 purchased). Every request from OpenScience fails, even a plain "ping" in a new session:

Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits. (HTTP 400)

The same key and model work fine with curl and in the Console Playground.

The cause is the hardcoded claude-code-20250219 beta header on Anthropic requests:

"anthropic-beta":
"claude-code-20250219,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14",

With that header, the request seems to be billed as Claude Code, which the Max/Team API credits don't cover (docs). So it falls through to the empty purchased balance.

Expected: BYOK API-key requests are billed as normal API usage. Suggested fix: drop claude-code-20250219 from the default headers.

Steps to reproduce

  1. Use an API key from a Console org that only has Max/Team plan API credits.
  2. Send any message in OpenScience → HTTP 400 "credit balance is too low".
  3. Same key, no beta header → 200 OK:
   curl https://api.anthropic.com/v1/messages \
     -H "x-api-key: $KEY" -H "anthropic-version: 2023-06-01" \
     -H "content-type: application/json" \
     -d '{"model":"claude-opus-5-5","max_tokens":50,"messages":[{"role":"user","content":"hi"}]}'
  1. Add only -H "anthropic-beta: claude-code-20250219" → HTTP 400 "credit balance is too low".

Workaround: override the header in ~/.config/openscience/openscience.json:

{ "provider": { "anthropic": { "options": { "headers": {
  "anthropic-beta": "interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14"
} } } } }

How did you install OpenScience?

Desktop app (DMG / EXE / AppImage)

OpenScience version

2.0.151

Provider and model

Anthropic, claude-opus-5-5, direct API key (BYOK)

Operating system

macOS 27.0.1

Action approval mode

Ask risky (default)

openscience doctor output

jinho@Jinhos-MacBook-Pro ~ % openscience doctor

┌  openscience doctor
│
●  Binary: /Applications/OpenScience.app/Contents/Resources/sidecar/openscience
│
●  Version: 2.0.151
│
●  Channel: latest
│
●  Platform package: @synsci/openscience-darwin-arm64
│
●  Frontend version: 2.0.151 (latest)
│
●  Config root: /Users/jinho/.config/openscience
│
●  Data root: /Users/jinho/.config/openscience/data-root
│
●  Cache root: /Users/jinho/.cache/openscience
│
●  State root: /Users/jinho/.local/state/openscience
│
◆  Provider keys: anthropic
│
●  Default model: auto (chosen from available providers)
│
◆  Sandbox: on (seatbelt)  (run `openscience sandbox test`)
│
└  Done

Logs and screenshots

No response

Activity

  1. added
    bug
    needs-triage
    on Oct 17, 2026
  2. added a commit that references this issue on Oct 18, 2026
    fba1e99
  3. aayambansal commented on Oct 18, 2026

    @aayambansal
    Member

    Fixed in #996, now squash merged to main. Direct Anthropic requests no longer add the claude-code-20250219 billing header. Required CI, provider tests, web/frontend checks, and runtime compatibility checks passed.

    This is a source fix; an existing 2.0.151 installation will need a release containing it. The header override in your report remains a workaround in the meantime. Thank you for the isolated comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions