gemini-cli - 💡(How to fix) Fix CRITICAL: Total Auth Failure in v0.37.1 — Paid Pro/AI Studio Keys Rejected Despite Full Troubleshooting [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25219Fetched 2026-04-13 05:45:45
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

Auth Misrouting: Even after unsetting GOOGLE_CLOUD_PROJECT and wiping ~/.gemini, the CLI returns a 400 Invalid API Key error. It appears the CLI is failing to route requests correctly to the generativelanguage.googleapis.com endpoint for individual API keys, instead defaulting to an enterprise-level check that fails.

Root Cause

I previously abandoned the AI Pro subscription because it was unusable "trash." I switched to the API tier specifically to avoid those loops and pay for what I use. Instead, I have spent hours of my own time acting as an unpaid QA engineer for a product that doesn't work.

Code Example

> /about
# paste output here
RAW_BUFFERClick to expand / collapse

What happened?

I am reporting a complete breakdown of the Gemini CLI v0.37.1 on macOS. I am a technical user on the Gemini API Paid Tier (Billing Account linked), and despite having a positive credit balance and a valid key, the CLI is non-functional.

The Technical Failure:

Auth Misrouting: Even after unsetting GOOGLE_CLOUD_PROJECT and wiping ~/.gemini, the CLI returns a 400 Invalid API Key error. It appears the CLI is failing to route requests correctly to the generativelanguage.googleapis.com endpoint for individual API keys, instead defaulting to an enterprise-level check that fails.

Performance Loops: In the rare moments the CLI connects, it enters infinite "thinking" loops or hangs for 5+ minutes on simple queries, eventually timing out.

Wasted Troubleshooting: I have followed all troubleshooting guides, including generating new keys in AI Studio, reinstalling the CLI, and clearing all environment variables. The software remains a brick.

I previously abandoned the AI Pro subscription because it was unusable "trash." I switched to the API tier specifically to avoid those loops and pay for what I use. Instead, I have spent hours of my own time acting as an unpaid QA engineer for a product that doesn't work.

At this point, I am not even asking for a refund of my prepay credits; I am simply disgusted by the lack of reliability in a product sold to developers. This tool is currently a "gumbo of trash" that wastes the time of the very people trying to build on your platform.

Environment:

OS: macOS (Apple Silicon)

CLI Version: 0.37.1

Auth Tier: Gemini API Paid Tier (AI Studio Key)

Model: gemini-3.1-pro-preview

What did you expect to happen?

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here
</details>

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The Gemini CLI v0.37.1 on macOS may be experiencing authentication misrouting and performance issues due to incorrect endpoint routing or environment variable configuration.

Guidance

  • Verify that the GOOGLE_CLOUD_PROJECT environment variable is completely unset and that the ~/.gemini directory has been wiped clean to ensure no residual configuration is causing the issue.
  • Check the API key configuration in AI Studio to ensure it is correctly set up for the Gemini API Paid Tier and that the key is properly validated.
  • Attempt to use a different API key or recreate the key in AI Studio to rule out any issues with the current key.
  • Consider testing the CLI with a different model, such as a non-preview version, to see if the issue is specific to the gemini-3.1-pro-preview model.

Example

No code example is provided as the issue does not require a specific code change.

Notes

The issue may be specific to the macOS (Apple Silicon) environment or the gemini-3.1-pro-preview model, and further testing may be required to determine the root cause.

Recommendation

Apply workaround: Attempt to use a different API key or recreate the key in AI Studio to rule out any issues with the current key, as this may resolve the authentication misrouting issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING