CLI silently loads API key from .env file, bypasses /auth selection, causes unintended Vertex AI billing #24503
n3g3ntr0pe
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I recently discovered I'd been billed $34 for Vertex AI usage that I believed I'd configured to use the free tier. I'm sharing what I found in case it helps others, and because I think there are some UX improvements worth considering.
What happened
I had selected Type: "vertex-ai" in my settings.json and a GOOGLE_API_KEY in a ~/.env file that I'd created months ago for a different purpose. I wasn't aware the CLI would find and load it.
Over several sessions, I used /auth signin and /auth signout to switch Google accounts, believing this controlled which account was billed. It didn't — those commands change identity, not billing method. The /auth command (bare) changes the billing method, but the naming doesn't make this distinction clear.
I also tried deleting mcp-oauth-tokens-v2.json and signing out of my browser. Neither helped, because the actual credential was the API key being silently loaded from .env.
Root cause
vertex-ai, requests route to the paid Vertex AI endpoint
Suggestions
(free)" in the status bar
things (billing method vs account identity)
help
Environment
Related discussions: #4472, #4841, #4495
Thanks for building the CLI — I use it regularly and want it to succeed. These are solvable UX issues that would save
others from the same experience.
Beta Was this translation helpful? Give feedback.
All reactions