Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Gemini CLI error

Gemini CLI: Failed to sign in. Message: Request contains an invalid argument

Error message
Failed to sign in. Message: Request contains an invalid argument

Status: WorkaroundLast verified 2 documented fixes2 sources

What it means

Free-tier activation of Gemini Code Assist failed during Sign in with Google.

Causes

  • Users with Google Workspace accounts or Google Cloud accounts associated with their Gmail accounts may not be able to activate the free tier of the Google Code Assist plan (official troubleshooting guide).

How to fix it

  1. Fix 1.

    For Google Cloud accounts, set GOOGLE_CLOUD_PROJECT to your project ID.

    Terminal
    export GOOGLE_CLOUD_PROJECT="your-project-id"
  2. Fix 2.

    Alternatively, get a Gemini API key from Google AI Studio (http://aistudio.google.com/app/apikey), which includes a separate free tier, and set GEMINI_API_KEY.

    Terminal
    export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"

More Gemini CLI errors

All 19 Gemini CLI errors

FAQ

What does "Failed to sign in. Message: Request contains an invalid argument" mean in Gemini CLI?

Free-tier activation of Gemini Code Assist failed during Sign in with Google.

How do I fix "Failed to sign in. Message: Request contains an invalid argument"?

There are 2 documented fixes. Start with the first: For Google Cloud accounts, set GOOGLE_CLOUD_PROJECT to your project ID.

Is this Gemini CLI error fixed?

Status: Workaround. No release removes the cause. The documented fixes work around it.

Sources

Last verified against 2 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.