Repository navigation
Description
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:
openscience/backend/cli/src/provider/provider.ts
Lines 1380 to 1381 in 722ad05
| "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
- Use an API key from a Console org that only has Max/Team plan API credits.
- Send any message in OpenScience → HTTP 400 "credit balance is too low".
- 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"}]}'- 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
fix(provider): drop the claude-code beta header from Anthropic reques…
aayambansal commentedon Oct 18, 2026
Fixed in #996, now squash merged to
main. Direct Anthropic requests no longer add theclaude-code-20250219billing 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.