[Bug]: API-key Claude instances fail with "Credit balance is too low" on subscriber API credits since the t3-code entrypoint#29393

opened9d agobyKkyle944

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Use a Claude Max or Team plan and link a Console organization that holds only the included API credits for subscribers, with no purchased balance.
  2. In T3 Code, add a claudeAgent provider instance with ANTHROPIC_API_KEY set to a key from that organization.
  3. Send any prompt on that instance.

The cause reproduces outside T3 Code with the same key. Only the entrypoint value changes:

shell
1CLAUDE_CODE_ENTRYPOINT=t3-code ANTHROPIC_API_KEY=<key> claude -p 'Reply with the single word ok' --model claude-haiku-5-5 --setting-sources '' --strict-mcp-config --no-session-persistence --output-format json
2CLAUDE_CODE_ENTRYPOINT=sdk-cli ANTHROPIC_API_KEY=<key> claude -p 'Reply with the single word ok' --model claude-haiku-5-5 --setting-sources '' --strict-mcp-config --no-session-persistence --output-format json

Expected behavior

The turn runs and draws on the credits. T3 Code runs Claude through the Agent SDK, and Anthropic's documentation lists the Agent SDK as covered by these credits.

Actual behavior

Every turn fails in under a second with Credit balance is too low, while the Console shows the balance available. T3 Code shows "Claude gave up after repeated API errors." Replacing the key does not help, so the message sends people to the wrong fix.

The likely cause is #28410, merged 2026-11-02, which replaced the Agent SDK default sdk-ts with CLAUDE_CODE_ENTRYPOINT=t3-code in mergeClaudeProcessEnvironment (apps/server/src/provider/Drivers/ClaudeHome.ts).

Results with one key, on one credit-only organization:

EntrypointModelResult
t3-codeHaiku 5.5Credit balance is too low
t3-codeOpus 5.5Credit balance is too low
t3-code, with user settingsHaiku 5.5Credit balance is too low
sdk-cliHaiku 5.5Worked
sdk-cliOpus 5.5Worked
sdk-cli, with user settingsHaiku 5.5Worked
cliHaiku 5.5Worked

A direct POST /v1/messages with the same key also worked.

Not verified:

  • sdk-ts itself. I did not run it. It is the value before #28410, according to that PR.
  • That this instance worked in T3 Code before #28410. My local logs do not go back far enough to show it.
  • How Anthropic classifies requests. I only observed that the result follows the entrypoint value. The documentation says these credits do not cover Claude Code, so an unrecognized entrypoint may be treated that way.
  • An organization that also has purchased credits. The documentation suggests the request would run and be charged to the purchased balance.

Possible fix: keep t3-code for subscription logins, and leave the Agent SDK default in place when the instance authenticates with ANTHROPIC_API_KEY. Whichever fix is chosen, showing the CLI's error text would help. The failed runs reported billing_error with HTTP 400, but the thread said only that Claude gave up after repeated API errors.

Impact

Blocks work completely

This applies to API-key Claude instances on organizations that hold only these credits.

Version or commit

Desktop 0.1.7-nightly.20261102.4080. The t3-code default is still on main as of 2026-11-02.

Environment

macOS (Darwin 27.0.0), Claude Code 2.1.316, Agent SDK 0.3.276, claude-opus-5-5 and claude-haiku-5-5

Logs or stack traces

shell
1"apiKeySource":"ANTHROPIC_API_KEY"
2"model":"<synthetic>","error":"billing_error","text":"Credit balance is too low"
3"is_error":true,"api_error_status":400,"result":"Credit balance is too low","total_cost_usd":0

Workaround

Use a Claude instance that signs in with the subscription. #28410 also lets CLAUDE_CODE_ENTRYPOINT in the instance's environment override the default, but I did not test that inside T3 Code.

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Synced from GitHub

Update: I have now tested sdk-ts, which the report above listed as not verified.

I set CLAUDE_CODE_ENTRYPOINT=sdk-ts in the environment of the same API-key provider instance, using the override that #28410 allows, and changed nothing else. The same instance, stored key and T3 Code build then worked through T3 Code on Haiku 5.5 and Opus 5.5, where both had failed with Credit balance is too low. The included credit balance went down after the runs, so the credits paid for them.

This confirms the workaround inside T3 Code, and that the Agent SDK default is accepted for these credits. It does not change the suggested fix. It also still does not show that this instance worked before #28410.

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Synced from GitHub

Additional reproduction on Linux x64 with T3 Code Desktop and its local server, both version 0.1.8-nightly.20261104.4179 (commit 9e85538535c8553901351112ab02dd1dd62db5ee), and Claude Code 2.1.318.

This case uses credentials stored by claude auth login --console, rather than an ANTHROPIC_API_KEY provider override. The user has subscriber-included promotional Console credits. There was no ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN override in the affected T3 Claude process.

Evidence from the affected machine:

  • Continuing an existing Claude thread returns billing_error, Credit balance is too low; the run ends with Claude gave up after repeated API errors. A fresh triage thread failed the same way, so the symptom is not limited to resuming old threads.
  • A fresh standalone CLI request succeeded. A fresh process using the affected T3 Claude process environment failed with HTTP 400 and the same billing error.
  • Removing only CLAUDE_CODE_ENTRYPOINT from that environment made the request succeed. Removing only CLAUDE_CODE_SDK_READS_SESSION_STATE did not.
  • Signing in again through CLAUDE_CODE_ENTRYPOINT=t3-code claude auth login --console and restarting T3 did not resolve the failure.
  • A further fresh standalone request explicitly using CLAUDE_CODE_ENTRYPOINT=sdk-ts with the existing login returned OK, is_error=false, and no API error status.

The exact release source still sets CLAUDE_CODE_ENTRYPOINT: "t3-code" unconditionally in apps/server/src/provider/Drivers/ClaudeHome.ts. The results are consistent with the regression described here and the entrypoint change in #28410.

With the user's approval, CLAUDE_CODE_ENTRYPOINT=sdk-ts has now been added to the T3 Claude provider's environment. The persisted configuration was verified; an end-to-end T3 turn after applying it has not yet been verified. No credentials or account identifiers are included in this comment.

This adds a Console-login case relevant to #29408: that PR explicitly lists Console login credentials as outside the tested/fixed API-key environment path. Please consider covering that path too.

Prepared by GPT-6.1 Sol through the Codex harness in T3 Code, with the user's authorization.

Synced from GitHub

Same failure on the stable build, with a few data points this thread doesn't have yet.

T3 Code Desktop 0.1.7, macOS, Claude Code 2.1.319. One Console key; I don't know whether its organization holds only the included credits.

claude -p with an empty config directory and a minimal environment, changing only CLAUDE_CODE_ENTRYPOINT:

EntrypointResult
unset, cli, sdk-cli, sdk-ts, sdk-pyWorked
t3-code, claude-desktop, mcp, an arbitrary stringCredit balance is too low

So a label outside that accepted set fails the same way. This also misleads anyone testing from a shell that inherits a desktop app's CLAUDE_CODE_ENTRYPOINT.

Two override routes inside T3 Code:

  • CLAUDE_CODE_ENTRYPOINT=sdk-ts as an instance environment variable: four claudeAgent instances each completed a turn with apiKeySource: ANTHROPIC_API_KEY with no T3 restart after saving the rows.
  • env.CLAUDE_CODE_ENTRYPOINT in the instance home's settings.json: also works, but only after a T3 restart. mergeClaudeProcessEnvironment reads it when the driver is created, so a run right after editing the file still failed.

A captured request under t3-code and under sdk-ts differs in the user-agent label, the cc_entrypoint field of the billing line at the start of the system prompt, and one tool (Artifact, offered only under t3-code).

+1 to the fix suggested above: keep t3-code for subscription logins and leave the Agent SDK default on instances that authenticate with ANTHROPIC_API_KEY.

Synced from GitHub

Another way the t3-code entrypoint breaks: Claude through CLIProxyAPI rejects newer models. This is a different symptom from the credit-balance error, but the root cause is the same: t3-code isn't an entrypoint that downstream services recognize.

Setup: T3 Code Desktop (Nightly) 0.1.8-nightly.20261109.4429 with its local server, on Windows 10 x64. Claude Code 2.1.321 (the native claude.exe T3 launches). The user Claude settings env set ANTHROPIC_BASE_URL to a CLIProxyAPI instance and set ANTHROPIC_AUTH_TOKEN (no ANTHROPIC_API_KEY).

Symptom: every turn on claude-fable-5-2 fails immediately with: API Error: 400 Claude Code 2.1.280 does not support this model; version 2.1.290 or newer is required. In the same session, the CLI's own system/init reports claude_code_version: "2.1.321". Opus 5.5 works.

Repro outside T3 (same binary, same proxy; only the entrypoint changes):

1CLAUDE_CODE_ENTRYPOINT=<value> claude -p --model claude-fable-5-2 "Reply with just: ok"
EntrypointFable 5.2
cli, sdk-ts, claude-vscodeok
t3-code, my-random-app400 "Claude Code 2.1.280 does not support this model"
t3-code with Opus 5.5ok

2.1.280 matches CLIProxyAPI's documented Claude baseline (see #13213). The proxy appears to treat an unrecognized entrypoint as a non-native client and rewrites the request to that baseline version. So with the t3-code default, any model whose minimum version is above the proxy's baseline becomes unusable. I couldn't test without the proxy, because auth goes through it.

Workaround (confirmed in T3 Code): add "CLAUDE_CODE_ENTRYPOINT": "sdk-ts" to the env block of ~/.claude/settings.json. mergeClaudeProcessEnvironment uses that value in place of the default. After restarting T3, a new Fable 5.2 thread completed normally. On the proxy side, CLIProxyAPI v8.0.53+ has a native-entrypoints option where t3-code can be added.

#29408 only skips t3-code when ANTHROPIC_API_KEY is set, so it wouldn't fix this auth-token-plus-proxy setup. Defaulting back to sdk-ts, or otherwise using an entrypoint in Claude Code's accepted set, would fix both cases.

Triage by Claude Opus 5.5 (claude-opus-5-5) in Claude Code via t3 triage.