gemini-cli - ✅(Solved) Fix GEMINI_API_KEY can contain dots. [1 pull requests, 1 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#25553Fetched 2026-04-17 08:55:16
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #25497: Allow dots on GEMINI_API_KEY

Description (problem / solution / changelog)

Summary

Gemini CLI should support new API Key format. Fixes #25553

Details

New API Keys bounded to Service Accounts have the following format

AQ.Ab8RN6LEVE.....

Currently Gemini CLI doesn't allow dots on when capturing the Gemini API Key, therefore using a valid API Key may throw the following error:

✕ [API Error: {"error":{"message":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Request had invalid authentication credentials. Expected OAuth 2
access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.\",\n
\"status\": \"UNAUTHENTICATED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.ErrorInfo\",\n \"reason\":
\"ACCESS_TOKEN_TYPE_UNSUPPORTED\",\n \"metadata\": {\n \"service\": \"generativelanguage.googleapis.com\",\n \"method\":
\"google.ai.generativelanguage.v1beta.GenerativeService.StreamGenerateContent\"\n }\n }\n ]\n }\n}\n","code":401,"status":"Unauthorized"}}]

How to Validate

Create a new API Key on a project with the policy "Block service account API key bindings" try to use this API Key on Gemini CLI using UI

Pre-Merge Checklist

  • [ X] Updated relevant documentation and README (if needed)
  • [ X] Added/updated tests (if needed)
  • [ X] Noted breaking changes (if any)
  • [ X] Validated on required platforms/methods:
    • [ X] MacOS
      • [X ] npm run
      • [ X] npx
      • [ X] Docker
      • [ X] Podman
      • [ X] Seatbelt
    • [ X] Windows
      • [X ] npm run
      • [ X] npx
      • [ X] Docker
    • [ X] Linux
      • [X ] npm run
      • [ X] npx
      • [ X] Docker

Changed files

  • packages/cli/src/ui/auth/ApiAuthDialog.tsx (modified, +1/-1)

Code Example

> /about
About Gemini CLI│                                                                                                                                                                                  │ 
CLI Version                                                   0.37.1Git Commit                                                    3b2d4f100                                                                                                          │ 
Model                                                         Auto (Gemini 3)Sandbox                                                       no sandbox                                                                                                         │ 
OS                                                            linux                                                                                                              │ 
Auth Method                                                   gemini-api-key                                                                                                     │ 
GCP Project                                                   cloudshell-gca
RAW_BUFFERClick to expand / collapse

What happened?

The new API Keys bounded to service accounts now has the following format

AQ.XXXXXXXXX

And currently it is not possible to use dots in the Sign in UI

<img width="1748" height="554" alt="Image" src="https://github.com/user-attachments/assets/c6571297-62fd-4d25-b6a8-188d9cfec82f" />

What did you expect to happen?

Allow dots in Sign in UI

Client information

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

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

> /about
│ About Gemini CLI                                                                                                                                                                 │ 
│                                                                                                                                                                                  │ 
│ CLI Version                                                   0.37.1                                                                                                             │ 
│ Git Commit                                                    3b2d4f100                                                                                                          │ 
│ Model                                                         Auto (Gemini 3)                                                                                                    │ 
│ Sandbox                                                       no sandbox                                                                                                         │ 
│ OS                                                            linux                                                                                                              │ 
│ Auth Method                                                   gemini-api-key                                                                                                     │ 
│ GCP Project                                                   cloudshell-gca
</details>

Login information

API Key bounded to service account AKA Authorization Keys https://docs.cloud.google.com/docs/authentication/api-keys#api-keys-bound-sa

Anything else we need to know?

No response

extent analysis

TL;DR

The Sign in UI needs to be updated to allow dots in API Keys, which are now formatted as AQ.XXXXXXXXX.

Guidance

  • Verify the current Sign in UI configuration to check if there are any existing restrictions on special characters.
  • Check the documentation for the Sign in UI to see if there are any known issues or limitations with handling dots in API Keys.
  • Consider reaching out to the development team responsible for the Sign in UI to report the issue and request an update to support the new API Key format.
  • Test the Sign in UI with a different API Key format to see if the issue is specific to the new AQ.XXXXXXXXX format.

Notes

The issue seems to be specific to the Sign in UI and its handling of the new API Key format. Without more information about the UI's configuration or code, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: Update the Sign in UI to allow dots in API Keys, as the new format is now widely used and the current restriction is causing issues.

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