How can I check my requests per day remaining? #3096
-
|
Using API, I can check it in Google AI Stuido.
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
|
You can always use the |
Beta Was this translation helpful? Give feedback.
-
|
Try google cloud... it has the possibility to add gemini api, to a cloud project. Just ignore the cloud project and use the key from it for local gemini api usage etc... but it has metered thing in the cloud that can show what the gemini is using... yes... it's a bit strange and all, and sometimes it lags or doesn't work/update or maybe even limit is not there, but it probably is, but sometimes it works :):):) |
Beta Was this translation helpful? Give feedback.
-
|
Well, you can also teach Gemini CLI (via MCP would be best) to read your online usage ... |
Beta Was this translation helpful? Give feedback.
-
|
Discussion: Approaches for Checking Gemini API Daily Usage This document outlines various approaches for the Gemini CLI to check and display the user's daily Gemini API usage. The primary goal is to provide transparency on API consumption, especially concerning the free tier limits. Option 1: Hypothetical Direct Gemini API Endpoint Description: Pros:
Cons:
Option 2: Google Cloud Monitoring via Description: Pros:
Cons:
Option 3: Google Cloud Monitoring Python Client Library (Programmatic) Description: Pros:
Cons:
Conclusion: ♊ AI, 📯 on behalf of Manamama |
Beta Was this translation helpful? Give feedback.
-
Implementation Plan: Checking Gemini API Daily Usage in the CLIThis document outlines a phased implementation plan for integrating Gemini API daily usage checking into the Gemini CLI. The approaches are ordered from most feasible and recommended to least feasible, providing a clear path forward for development. Phase 1: Most Feasible - Google Cloud Monitoring via Python Client LibraryApproach Overview:This approach leverages the official Core Mechanism:The Python client library will fetch the Minimal Pseudocode/Example:from google.cloud import monitoring
from datetime import datetime, timedelta
def get_gemini_api_daily_usage(project_id: str) -> int:
client = monitoring.Client(project=project_id)
end_time = datetime.utcnow()
start_time = end_time - timedelta(days=1) # Query for the last 24 hours
query = client.query(metric_type='cloudaicompanion.googleapis.com/usage/response_count')
query = query.select_interval(start_time, end_time)
query = query.align(monitoring.Aggregation.Aligner.ALIGN_DELTA, hours=24)
total_requests = 0
for ts in query.fetch():
for point in ts.points:
# Assuming double_value for simplicity, could be int64_value or distribution_value.count
total_requests += point.value.double_value
return int(total_requests)
# Example CLI integration:
# PROJECT_ID = GET_GCLOUD_PROJECT_ID()
# if PROJECT_ID:
# daily_usage = get_gemini_api_daily_usage(PROJECT_ID)
# DISPLAY_MESSAGE(f"Gemini API requests (last 24h): {daily_usage}")Pros:
Cons:
Phase 2: Viable Alternative - Google Cloud Monitoring via
|
Beta Was this translation helpful? Give feedback.
-
This entire thread is the exact reason EVERYONE needs to recognize Google for the sketchy, shady company that they are and then stay the F&#K away from their products, let alone a Product like Gemini that can easily burn through your money in a VERY FAST WAY - and then they have the balls to make it so you only get notified once you PASS $100 IN OVERAGES. Nobody can convince me this is all just a 'big misunderstanding'. It's the reason they got slapped by the FTC and hopefully the reason they will once again. Good riddance. They just continue to target their loyal chump-base who keep getting absolutely abused, but still crawl back, for another taste of their garbage juice.This Discussion Thread is nothing short of ASTOUNDING - That a person can ask 'hey, how do I check my usage?' and then PAGES UPON PAGES of people reply with what amount to elaborate work arounds for something I'm fairly confident Google is required BY LAW TO HAVE: transparent billing. This ain't it. And yet, it's reply after reply filled with the most bizarre answers. Are you guys actually OK with things being like this? Half of these answers just seem like Stockholm Syndrome excuses with wild, Rube Goldberg-like instructions. For what? For them to just keep taking your money... and not even using it on lube? For those of you willing to allow yourselves to be abused by a Clearly Bad Company, yikes. Good luck I guess. To top it all off, it's not like Gemini is capable of producing flawless let alone usable code in any reasonable number of hours. Ask it to vibe code a solution to this problem and watch yourself end up in the hole well before some other tool could accomplish the same. There's no denying that the original question still has ZERO WAYS TO ACTUALLY SEE WHAT THEY'VE ASKED FOR. TL;DR: **This is almost certainly criminal behavior, and I truly hope the FTC slaps them hard to the tune of Billions again.(I would have insisted someone photoshopped this whole thing if I didn't see it with my own two eyes.) |
Beta Was this translation helpful? Give feedback.
You can always use the
/statscommand to see the usage for a particular session, but there's no way within Gemini CLI to see your daily quota – at least, not yet.