claude-code - 💡(How to fix) Fix Feature Request: Runtime switch between Subscription and Vertex/API billing [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53013Fetched 2026-04-25 06:14:43
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

Root Cause

Users who have both a Subscription (Pro/Max) and Vertex/API configured want to flexibly switch — e.g. use Subscription quota first, then switch to Vertex when exhausted, or vice versa. The current UX is asymmetric: overflow from Subscription is smooth, but switching back requires manual env var changes and a restart.

Fix Action

Fix / Workaround

When using Claude Code with Vertex AI (CLAUDE_CODE_USE_VERTEX=1), there is no way to switch back to Subscription billing without restarting the CLI. The only workaround is toggling the environment variable and restarting.

Current Workaround

Code Example

export CLAUDE_CODE_USE_VERTEX=0  # switch to subscription
export CLAUDE_CODE_USE_VERTEX=1  # switch to vertex
# then restart claude
RAW_BUFFERClick to expand / collapse

Problem

When using Claude Code with Vertex AI (CLAUDE_CODE_USE_VERTEX=1), there is no way to switch back to Subscription billing without restarting the CLI. The only workaround is toggling the environment variable and restarting.

Meanwhile, when on a Subscription plan and the included quota is exhausted, Claude Code does offer an interactive prompt to enable extra usage (overflow to API billing). This shows the infrastructure for runtime billing switches exists — but only in one direction.

Expected Behavior

A command or toggle (e.g. /switch-billing, /account, or similar) that allows switching between configured billing providers (Subscription ↔ Vertex/API) at runtime without restarting the CLI.

Current Workaround

export CLAUDE_CODE_USE_VERTEX=0  # switch to subscription
export CLAUDE_CODE_USE_VERTEX=1  # switch to vertex
# then restart claude

Requires full CLI restart each time.

Why This Matters

Users who have both a Subscription (Pro/Max) and Vertex/API configured want to flexibly switch — e.g. use Subscription quota first, then switch to Vertex when exhausted, or vice versa. The current UX is asymmetric: overflow from Subscription is smooth, but switching back requires manual env var changes and a restart.

extent analysis

TL;DR

Implement a runtime command or toggle to switch between Subscription and Vertex AI billing without requiring a CLI restart.

Guidance

  • Investigate the existing infrastructure for runtime billing switches, as seen in the overflow to API billing when the Subscription quota is exhausted, to determine if it can be extended to support switching back to Subscription billing.
  • Consider adding a command or toggle, such as /switch-billing or /account, to allow users to switch between configured billing providers at runtime.
  • Review the current implementation of the CLAUDE_CODE_USE_VERTEX environment variable to understand how it interacts with the billing system and identify potential modifications to support dynamic switching.
  • Explore the possibility of caching or storing the user's billing preferences to facilitate seamless switching between billing providers.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a specific example.

Notes

The solution may require modifications to the underlying billing system and the CLI's configuration management. Additionally, the implementation should ensure a smooth user experience and handle any potential errors or edge cases that may arise during the switching process.

Recommendation

Apply a workaround by implementing a runtime command or toggle to switch between billing providers, as this would provide a more flexible and user-friendly experience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature Request: Runtime switch between Subscription and Vertex/API billing [1 comments, 2 participants]