Most users should use a Gemini API key (/key save gemini <key>) or Vertex AI. This page covers advanced Google Cloud authentication methods for enterprise and Workspace users.
Free individual access removed in mid-2026. Google has fully removed the free consumer "Login with Google" CLI access. Use a Gemini API key for individual use; Google Workspace users can still use the project / Vertex / ADC methods below.
You need Google Cloud authentication if:
- You have a Google Workspace account (managed by an employer or school)
- You received a Gemini Code Assist license through the Google Developer Program
- You have a Gemini Code Assist standard or enterprise subscription
- You're using LLxprt Code outside supported regions for free individual usage
- You're under 18 with a Google account
If you fall into one of the categories above, you need to configure a Google Cloud Project ID. First, enable the Gemini for Cloud API and configure access permissions.
Then set the project ID:
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"For persistent use, add this to your shell config (~/.bashrc, ~/.zshrc).
Get an API key from Google Cloud, then:
export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"If you see "API keys are not supported by this API," your organization may restrict API key creation. Use Application Default Credentials instead.
Unset any existing
GOOGLE_API_KEYorGEMINI_API_KEYfirst — they take precedence over ADC.
For local development with gcloud:
gcloud auth application-default login
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
export GOOGLE_CLOUD_LOCATION="us-central1"With a service account (for non-interactive environments):
- Create a service account with the "Vertex AI User" role
- Download the JSON key file
- Set the path:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/keyfile.json"
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
export GOOGLE_CLOUD_LOCATION="us-central1"When running in Google Cloud Shell, authentication uses the logged-in user's credentials automatically. No configuration needed — this is the default when no other method is configured.
- Authentication — Main authentication guide
- OAuth Setup — OAuth flows for all providers