> authentication

Gemini CLI supports three ways to authenticate: interactive Google login (the free tier), a Gemini API key from AI Studio, and Vertex AI for Google Cloud. The method is chosen on first launch, changeable later with /auth, and overridable by environment variables. Which one is active decides your quota, billing, and data-handling terms.

// authentication

5 commands

// faq

What are the free tier rate limits?

Logging in with a personal Google account gives 60 requests per minute and 1,000 requests per day at no cost. Google AI Pro and Ultra subscribers get higher limits on the same login without any extra setup.

Why does my Google Workspace account fail to sign in?

Organization and Workspace accounts often cannot use the personal free-tier OAuth flow. Set GOOGLE_CLOUD_PROJECT to a Google Cloud project you have access to before launching gemini, which routes the login through that project.

How do I use a Gemini API key instead of logging in?

Create a key in Google AI Studio and export it as GEMINI_API_KEY (persist it in your shell profile or ~/.gemini/.env). The CLI uses it automatically, and because it takes precedence over a cached Google login, it silently switches you onto API billing until you unset it.

How do I connect Gemini CLI to Vertex AI?

Unset any API keys, set GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION, then run gcloud auth application-default login for interactive use, or point GOOGLE_APPLICATION_CREDENTIALS at a service-account JSON for CI. Vertex offers higher limits and keeps traffic inside your Cloud project.