API renew after just using for 1 hour , How do i fix it?
What happened?
First time using gemini cli, Built an android project for about one hour.
Usage details tells me i used up 3 million input tokens.
But in bottom right of cli i am seeing 100% context left.
This is the error i get
"[API Error: {"error":{"message":"{\n \"error\": {\n \"code\": 400,\n \"message\": \"API key expired. Please renew the API key.\",\n \"status\": \"INVALID_ARGUMENT\",\n \"details\": [\n
{\n \"@type\": \"type.googleapis.com/google.rpc.ErrorInfo\",\n \"reason\": \"API_KEY_INVALID\",\n \"domain\": \"googleapis.com\",\n \"metadata\": {\n
\"service\": \"generativelanguage.googleapis.com\"\n }\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.LocalizedMessage\",\n \"locale\": \"en-US\",\n
\"message\": \"API key expired. Please renew the API key.\"\n }\n ]\n }\n}\n","code":400,"status":"Bad Request"}}]
I have tried to use a newly generated api key from ai studio and still same problems.
Please help me fix it.
What did you expect to happen?
I expected to continue using gemini CLI
Client information
$ gemini /about
# About Gemini CLI │
│ │
│ CLI Version 0.1.12 │
│ Model gemini-2.5-pro │
│ Sandbox no sandbox │
│ OS linux │
│ Auth Method gemini-api-key
Login information
Auth
Anything else we need to know?
The context window seems to be very misleading. I used 3 million input tokens in 1 hour and it just kept saying i still had 95% usage left.
Found possible duplicate issues:
- #1712: (0.9083024263381958)
- #4690: (0.9082939299432619)
@arrowtrades is this still an issue for you?
I'm having this issue as well. Error occurs after 2 mins of usage
I seem to have solved it by enabling gemini code assist for my project. Using this page
https://console.cloud.google.com/gemini-admin/products?project=
@arrowtrades I'm sorry you ran into this issue. Unfortunately, there isn't enough information to repro this bug. If you are still running into this issue, please file a new issue with detailed repro instructions. Thanks!