Skip to main content
Watch: Anthropic Just Hit the Brakes on Its Next AI Model

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 fixes3 sources

What it means

Free-tier activation of Gemini Code Assist failed during Sign in with Google. The deployed docs pages also carry a banner: "Unpaid tier and Google One users: Gemini CLI was replaced by Antigravity CLI on June 18th, 2026."

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 (official troubleshooting guide), and set GEMINI_API_KEY as the authentication docs show.

    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. The deployed docs pages also carry a banner: "Unpaid tier and Google One users: Gemini CLI was replaced by Antigravity CLI on June 18th, 2026."

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 3 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.