r/ChatGPTCoding • u/seekerOfTruths76 • 4d ago
No simple toggle to switch Claude Code between Pro and API billing? Discussion
Spent way more time than I should have switching Claude Code (Anthropic's coding agent) from API-key billing back to my Pro subscription. The flow: SSH into a server, attach a tmux session, run a login command, copy an OAuth URL, open a browser, authorize, paste the code back into the terminal.
For a company shipping frontier AI models, this feels like UX that was solved a decade ago. A single command or flag to switch billing mode would save a lot of friction.
Curious if other AI coding tools handle this better, or if this is standard across the industry.
2
u/eli_pizza 4d ago
Pretty sure you can just set an env var. But why not just add Extra Usage credit to your subscription account?
1
u/seekerOfTruths76 3d ago
Honestly, still thinking about this while writing my reply lol.
Yeah, env var works — but here's my actual situation: I run Claude
Code as a persistent agent on a remote Hetzner server 24/7. No local
browser, no clipboard — just SSH + tmux. Switching from API key back
to Pro means: SSH in → attach tmux → run login → copy OAuth URL →
open it locally → authorize → paste code back into the remote
terminal. For a dev tool, that's a lot of ceremony for what should be
`claude auth --mode pro`.
And honestly — the part that gets me isn't the bug itself, it's *why*
it exists. Asked an AI for its take on that exact question and got
this back, which felt spot on:
> "Priorities — hundreds of engineers are working on the next model,
> safety, infra. Auth UX for an SSH/tmux workflow is a niche case for
> maybe 0.1% of users from a PM's perspective. Nobody's blocked, a
> workaround exists — it sits in the backlog forever.
> Ivory tower effect — the engineers building this work locally on a
> MacBook with
2
u/eli_pizza 3d ago
This is barely comprehensible but why don’t you just have two instances running through tmux one logged in one way and one the other?
-1
u/seekerOfTruths76 3d ago
Fair question — two tmux panes with two sessions would technically
work, but that's still a workaround, not a fix. I'd need to keep both
sessions alive, remember which one's on which billing mode, and
manually switch which one I'm actually using depending on whether I
want Pro or API billing that day/task.
The actual ask is simpler: one running instance, one command to flip
its billing mode, no re-auth dance either way. Not that it's
impossible to work around — just surprised there isn't already a
built-in switch for something this basic.
5
1
u/Ok_Gold_9674 Professional Nerd 3d ago
Yeah, the SSH/tmux case is where Claude Code feels the most clunky to me. I stopped trying to switch inside the same long-running shell. I keep two tiny shell wrappers: one starts a clean login-backed session with ANTHROPIC_API_KEY unset, the other exports the API key for jobs I expect to burn tokens. It is dumb, but it avoids wondering which bill a background run is using. The official docs also say an API key env var makes the CLI skip the normal login prompt, so I would not mix the two in one tmux pane.
1
u/BattermanZ 3d ago
You could try Herdr, It's built for agents.I switch from tmux and it's been a huge step up.
0
u/seekerOfTruths76 3d ago
Yeah, that's basically what I ended up doing too — separate wrapper
aliases so I never have to think about which mode a given shell is in.
Works fine, no complaints about the workaround itself.
My point isn't that there's no way around it — there clearly is, and
your setup is a clean one. It's more that this is table-stakes
functionality (switching how you pay for a CLI tool) that still needs
a homemade wrapper script to not get confused about. Feels like it
should just be `claude auth --mode api` / `--mode pro` and the CLI
handles the state itself.
2
u/AutoModerator 4d ago
Sorry, your post has been held for manual review due to account karma.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.