Skip to content

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

Open

Description

@kyle944

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:

CLAUDE_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
CLAUDE_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:

Entrypoint Model Result
t3-code Haiku 5.5 Credit balance is too low
t3-code Opus 5.5 Credit balance is too low
t3-code, with user settings Haiku 5.5 Credit balance is too low
sdk-cli Haiku 5.5 Worked
sdk-cli Opus 5.5 Worked
sdk-cli, with user settings Haiku 5.5 Worked
cli Haiku 5.5 Worked

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 update the claude entrypoint identifier for accuracy #28410, according to that PR.
  • That this instance worked in T3 Code before update the claude entrypoint identifier for accuracy #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

"apiKeySource":"ANTHROPIC_API_KEY"
"model":"<synthetic>","error":"billing_error","text":"Credit balance is too low"
"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

Activity

  1. kyle944 commented on Nov 2, 2026

    @kyle944
    Author

    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

  2. BrahimiMehdi commented on Nov 4, 2026

    @BrahimiMehdi

    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.

  3. thomasvan commented on Nov 9, 2026

    @thomasvan

    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:

    Entrypoint Result
    unset, cli, sdk-cli, sdk-ts, sdk-py Worked
    t3-code, claude-desktop, mcp, an arbitrary string Credit 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.

  4. miguelmg19877 commented on Nov 9, 2026

    @miguelmg19877

    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):

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

    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.

  5. sgmunn commented on Nov 11, 2026

    @sgmunn

    Additional triage on T3 Desktop 0.1.9, macOS arm64, Claude Code 2.1.322.

    Existing and fresh T3 chats returned billing_error, HTTP 400, “Credit balance is too low.” The CLI reports authMethod: api_key, apiKeySource: /login managed key, and forcedLoginMethod: console. User settings contain "forceLoginMethod": "console".

    Adding CLAUDE_CODE_ENTRYPOINT=sdk-ts to the T3 Claude provider persisted successfully, but a minimal prompt still failed.

    Standalone Haiku 5.5 tests, with tools disabled and session persistence disabled, failed identically under both sdk-ts and t3-code. Neither reported any token charge. No API-key, auth-token, base-URL, or config-directory environment overrides were set.

    Therefore this case does not reproduce an entrypoint-dependent failure. The ineffective workaround was removed. The user reports Claude Desktop still works, but its authentication method and the Console credit balance were not independently verified.

    Prepared by Codex, GPT-6.

  6. alipadron commented on Nov 12, 2026

    @alipadron

    Adding an independent reproduction on stable 0.1.8 (Linux, Claude Code 2.1.322), same key, same config directory, same model (claude-opus-5-5), changing only the label:

    CLAUDE_CODE_ENTRYPOINT Result
    unset, cli, sdk-ts, sdk-py turn completes
    foo (arbitrary string) 400 billing_error → Credit balance is too low
    t3-code 400 billing_error → Credit balance is too low

    Two things this narrows down:

    1. It is not t3-code specifically: any label outside the set Anthropic accepts lands on that billing path.
    2. The same shape appears with a service-account key (sk-ant-svc-…) on a Console organization whose balance is available — a curl /v1/messages with that key returns a normal completion at the same moment — so the key type is not the differentiator.

    One counterpoint to the report above: on 0.1.8, setting CLAUDE_CODE_ENTRYPOINT=sdk-ts as a provider instance environment variable does take effect. Instance variables are merged over the hardcoded value in mergeClaudeProcessEnvironment (mergeProviderInstanceEnvironment writes last), and I confirmed the spawned process carries sdk-ts in /proc/<pid>/environ and the turn succeeds. Worth checking whether the affected instance also had a cached /login credential, since that failure is reported with apiKeySource: /login managed key instead of an ANTHROPIC_API_KEY override.

    That override is what keeps 0.1.8 usable in the meantime. I am not proposing a competing patch: #29406's approach of leaving the label unset when the process authenticates with an API key is the right shape for this case.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions