429 error after switching to API key
What happened?
Added API key to env, switch /auth, signed in, then gemini immediately threw 429, even though it is not true. Context reports 100% left after switching.
What did you expect to happen?
Expected it to work when reporting 100% context left
Client information
- CLI Version: 0.1.4
- Git Commit: 1078a54
- Operating System: win32 v22.17.0
- Sandbox Environment: no sandbox
- Model Version: gemini-2.5-pro
- Memory Usage: 254.1 MB
Login information
API KEY (Working outside of Gemini CLI)
Anything else we need to know?
No response
Getting this same issue, fresh install of gemini-cli and having correctly exported the GEMINI_API_KEY variable.
CLI Version: 0.1.4
Git Commit: Used npm install -g @google/gemini-cli
NodeJS version: v23.2.0
Operating System: MacOS 15.5
Sandbox Environment: no sandbox
Model Version: gemini-2.5-flash
Memory Usage: ??
I can see on my billing and usage dashboard in Google AI Studio, showing that the gemini-cli app sent over 35k tokens to the API.
Here is the prompt and response:
> Create a robust and useful `GEMINI.md` file for me, in my `scratch-space` directory, that can configure
Gemini to become a useful Coding Assistant for me.
✕ [API Error: {"error":{"message":"{\n \"error\": {\n \"code\": 429,\n \"message\": \"Resource has been
exhausted (e.g. check quota).\",\n \"status\": \"RESOURCE_EXHAUSTED\"\n
}\n}\n","code":429,"status":"Too Many Requests"}}]
Please wait and try again later. To increase your limits, request a quota increase through AI Studio, or
switch to another /auth method
I haven’t tested this myself, but maybe try running the command with "DEBUG=* gemini" to get more detailed logs. It could help pinpoint where the 429 is coming from.
We are actively working on this investigation for more details you can see #1502