Credentials. Cloud keys can bill your organization; scope them and keep them in the environment.
Who it is forAn engineer at a company that already runs on Google Cloud.
The problemPersonal API keys are not allowed at many companies.
The outcomeGemini CLI running against Vertex AI under your organization's project and controls.
What you need first
- Node.js (npm), Homebrew, MacPorts or conda
- A Gemini API key from AI Studio or a Google Cloud project for Vertex AI
Steps
- Install the CLI
- Set
export GOOGLE_API_KEY="YOUR_API_KEY"andexport GOOGLE_GENAI_USE_VERTEXAI=true - Or set
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"for a Cloud project login - Run
geminiand confirm which project the requests use
Prompt for your agent
Configure google-gemini/gemini-cli to use Vertex AI in project <id> with GOOGLE_GENAI_USE_VERTEXAI=true, run one prompt, and tell me where usage will show up in the console.
Caveat.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for google-gemini/gemini-cli and "Use Gemini CLI through your company's Vertex AI project"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer