Gemini usage can be checked in several places, depending on how you access the model. If you use Gemini CLI, run /stats model inside an active session. If you use the Gemini API, open Google AI Studio and go to Dashboard > Usage.

That’s the short answer. Still, there’s an important difference between session tokens, model quota, API rate limits, and billing costs. They aren’t always shown on the same screen.

First, Know Which Gemini Usage You Want to Check

Before checking any numbers, identify how you’re using Gemini. A Gemini CLI session signed in with a Google account may not use the same quota as an API key connected to a Google Cloud project.

Here’s a simple breakdown:

Usage type Where it comes from Where to check it
Gemini CLI session Your current terminal session /stats session
Gemini CLI model usage Your CLI account or authentication plan /stats model
Gemini CLI tool activity Tools used during the session /stats tools
Gemini API usage Your Google Cloud project Google AI Studio Usage dashboard
Tokens used by one API call The API response usage_metadata
Paid API costs Your billing account AI Studio Billing or Google Cloud Billing

This difference explains why two usage screens may show different numbers. They may be tracking different accounts, projects, models, or time periods.

How to Check Gemini CLI Usage

Gemini CLI includes built-in commands for checking usage. These commands must be entered inside an interactive Gemini CLI session. They aren’t normal shell commands that you run before opening Gemini.

Start Gemini CLI as usual. Once the prompt is ready, use the command that matches the information you need.

Use /stats model to Check Tokens and Quota

The main Gemini CLI usage command is:

/stats model

This displays model-specific usage details. Depending on your Gemini CLI version and login method, you may see:

  • Models available to your account
  • Requests made to each model
  • Input and output token usage
  • The percentage of quota remaining
  • The estimated quota reset time
  • Usage for models that weren’t used in the current session

The command is useful when Gemini CLI switches models or warns that a usage limit is close. It can help you see whether the limit applies to one model family or your broader account quota.

Keep in mind that the output may change between versions. A personal Google account, Workspace account, API key, and Vertex AI setup may not display the same fields.

Use /stats session for Current Session Activity

To check statistics for the current Gemini CLI session, run:

/stats session

This view focuses on what happened since you started the session. It may show the session duration, number of requests, tool calls, and other performance information.

You can also enter:

/stats

The default /stats view normally opens the session statistics. This is useful for checking one work session, but it shouldn’t be treated as your complete daily or monthly API usage.

For example, closing Gemini CLI and starting another session creates a new session view. Your account quota may still include requests from earlier sessions.

Use /stats tools to Check Tool Activity

Gemini CLI can call tools to inspect files, search a project, run shell commands, and complete other tasks. To view tool-specific statistics, enter:

/stats tools

This helps when a session has performed many background actions. You can see which tools were called and how often they were used. Tool activity is not the same as model-token usage, though both may be part of the same work session.

Check the Summary When Exiting Gemini CLI

Gemini CLI may display a model usage summary when you leave an interactive session. This gives you another quick way to review what was used before the session closed.

The exit summary is helpful for a quick check. It isn’t a replacement for Google AI Studio or Cloud Billing when you need project-wide API history and costs.

How to Understand Gemini CLI Usage Statistics

The output from /stats model can contain several terms. Here’s what they usually mean:

Term Meaning
Requests Model requests counted during the shown period
Input tokens Tokens sent to the model as prompts, context, or files
Output tokens Tokens generated in the model’s response
Cached tokens Reused context that was already stored through caching
Usage left An estimate of the quota still available
Reset time When the related usage window should renew

A token is a small piece of content processed by the model. Text, code, images, audio, documents, and other input types can all affect token usage. A long source file will normally consume more tokens than a short question.

Cached-token details may not always appear. They usually depend on the authentication method and whether context caching is supported and being used.

Why Gemini CLI and API Usage May Show Different Numbers

Gemini CLI supports more than one authentication method. You may sign in with a personal Google account, use a Workspace account, provide a Gemini API key, or connect through Vertex AI.

When you sign in directly with a Google account, the CLI may use a Gemini Code Assist quota linked to that account. Those requests may not appear as Gemini API usage under an unrelated Google AI Studio project.

If you configure Gemini CLI with an API key, its requests count against the Google Cloud project that owns that key. In this case, usage may appear in Google AI Studio, though reporting can take some time.

Another common issue is the selected project. A Google account may have several projects and API keys. If the Usage dashboard is showing Project A while your key belongs to Project B, the numbers won’t match. Always confirm the project before assuming usage is missing.

How to Check Gemini API Usage in Google AI Studio

How to Check Gemini API Usage in Google AI Studio

Google AI Studio is the easiest place to check general Gemini API activity. It shows usage connected to your selected project.

Follow these steps:

  1. Sign in to Google AI Studio Use the Google account connected to your Gemini API project. If you use another account, the required project may not appear.
  2. Open the Dashboard From the AI Studio interface, open the main Dashboard. Menu names can move slightly when the interface is updated.
  3. Select Usage Go to Dashboard > Usage. This page shows the Gemini API usage available for your projects.
  4. Choose the correct project Check the project selector before reading the graphs. This step matters a lot, especially if you have created several API keys.
  5. Review models and time periods Use the available filters to check activity by model, metric, or time period. This can help you find traffic spikes or see which model is consuming the most quota.

The Usage page is meant for API activity. It may not show Gemini CLI activity when the CLI is signed in through a normal Google account instead of that project’s API key.

How to Check Gemini API Rate Limits and Remaining Quota

Gemini API limits are usually measured in three main ways:

Rate limit Meaning
RPM Requests per minute
TPM Input tokens per minute
RPD Requests per day

You can view your active rate limits in Google AI Studio. Select the correct project, then open its rate-limit or quota view. The exact limits depend on your model, project tier, billing status, and whether the model is stable, experimental, or in preview.

Each limit is checked separately. You could have daily requests remaining but still receive an error because too many requests were sent within one minute. A very large prompt could also reach the token-per-minute limit without reaching the request limit.

Gemini API rate limits are generally applied per project, not separately to each API key. If three API keys belong to the same project, their combined activity may use the same project quota. Creating another key in that project won’t give it a fresh limit.

Daily API request limits generally reset at midnight Pacific time. Other limits use shorter or rolling time windows.

How to Check Token Usage for One Gemini API Request

The AI Studio dashboard shows wider project activity. If you need the exact token use of one request, read the usage metadata returned by the API.

Check Tokens After a Response With usage_metadata

Here is a short Python example using the Google Gen AI SDK:

from google import genai

client = genai.Client()

response = client.models.generate_content(
model=”gemini-3.6-flash”,
contents=”Explain cloud storage in simple words.”
)

print(response.usage_metadata)

The response metadata may include:

  • prompt_token_count for input tokens
  • candidates_token_count for generated output
  • total_token_count for total usage
  • cached_content_token_count when cached context was used
  • thoughts_token_count when a thinking model reports thinking tokens

The available fields depend on the model and request type. A cached-token field may be missing when no context cache was used.

The same idea can be used in JavaScript:

import { GoogleGenAI } from “@google/genai”;

const ai = new GoogleGenAI({});

const response = await ai.models.generateContent({
model: “gemini-3.6-flash”,
contents: “Explain cloud storage in simple words.”
});

console.log(response.usageMetadata);

Use a currently supported model name for your project. Model names can change as new Gemini versions are released.

Estimate Input Tokens Before Sending a Request

You can call count_tokens before sending a prompt. This helps when you’re working with long files, large chat histories, or models with context limits.

Python example:

from google import genai

client = genai.Client()

result = client.models.count_tokens(
model=”gemini-3.6-flash”,
contents=”This is the prompt I want to measure.”
)

print(result.total_tokens)

For JavaScript:

import { GoogleGenAI } from “@google/genai”;

const ai = new GoogleGenAI({});

const result = await ai.models.countTokens({
model: “gemini-3.6-flash”,
contents: “This is the prompt I want to measure.”
});

console.log(result.totalTokens);

This method counts the input you provide. It cannot know how long the model’s final response will be. For total input and output usage, check the response metadata after generation.

How to Check Gemini API Costs and Billing

Token usage and billing cost are related, but they aren’t the same number. Prices can vary by model, input type, output, caching, and billing tier.

Check Billing in Google AI Studio

Check Billing in Google AI Studio

Open Google AI Studio and go to its Billing area. Depending on your account, you may see a Prepay or Postpay plan.

A Prepay account uses credits purchased in advance. The Billing page may show your available balance, transactions, auto-reload settings, and related controls. A Postpay account records costs and charges the linked payment method later.

You may also see project spend caps and billing status. Usage and billing information can take a short time to process, so the latest request may not appear at once.

Check Costs in Google Cloud Billing Reports

For a broader view of paid costs:

  1. Open Google Cloud Console.
  2. Go to Billing.
  3. Select the billing account linked to your project.
  4. Open Reports or Cost Reports.
  5. Filter by the correct project.
  6. Filter the service to Gemini API.
  7. Choose the required date range.

Cloud Billing Reports are better for reviewing spending history across projects and services. Google AI Studio is usually more direct for Gemini API usage, current billing status, and Prepay credit management.

Billing data in Google Cloud may appear later than usage data in AI Studio. A delay doesn’t always mean the requests were free or unrecorded.

Gemini CLI Usage vs. Gemini API Usage

Here’s the main difference in one place:

Feature Gemini CLI Gemini API
Main usage view /stats model AI Studio Dashboard > Usage
Session details /stats session Application logs
Tool activity /stats tools Application-specific logging
Per-request tokens CLI model statistics usage_metadata
Rate limits CLI quota display AI Studio rate-limit page
Costs Depends on authentication AI Studio or Cloud Billing
Usage scope Session or signed-in CLI plan Google Cloud project

If Gemini CLI uses an API key, the two sides may be connected. If the CLI uses Google-account authentication, its usage may belong to a different quota system.

What Does 429 RESOURCE_EXHAUSTED Mean?

A 429 RESOURCE_EXHAUSTED error usually means the request reached a quota, rate, or spending limit. It doesn’t always mean your full daily quota is gone.

Possible causes include:

  • Too many requests were sent within one minute
  • The input used too many tokens within the current minute
  • The project reached its daily request limit
  • A spend-based rate limit was reached
  • Another API key used the shared project quota
  • The selected model has a lower limit
  • The billing balance or account status has a problem

Read the complete error response. It may name the exact metric that failed, such as requests per minute or requests per day. That detail tells you whether to wait briefly, wait for the daily reset, change the request size, or check billing.

What to Do When Gemini Usage Is Missing or Incorrect

Start by checking your Gemini CLI authentication method. If you signed in with a Google account, don’t expect that usage to appear under every API project in AI Studio.

Next, work through this checklist:

  • Run /stats model inside an interactive Gemini CLI session.
  • Confirm which Google account is signed in.
  • Check whether Gemini CLI uses OAuth, an API key, or Vertex AI.
  • Find the Google Cloud project that owns your API key.
  • Select that same project in Google AI Studio.
  • Check whether other keys or applications share the project.
  • Update Gemini CLI if your /stats output looks old or incomplete.
  • Allow time for billing reports to process.
  • Read the complete quota error instead of relying only on the first line.

You may still see small timing differences between dashboards. Usage, quota enforcement, and billing reports are handled by different systems, so they don’t always update together.

Practical Ways to Reduce Gemini CLI and API Usage

Clear prompts usually need fewer follow-up calls. Tell Gemini what you need, what files matter, and what output format you want. Repeated corrections can use more requests and tokens than one well-scoped prompt.

A few other steps can help:

  • Avoid sending the same large file in every request
  • Remove old chat history that no longer matters
  • Use a lighter model for simple tasks
  • Set a reasonable maximum output size
  • Use context caching when repeated content fits that feature
  • Store usage_metadata in your application logs
  • Track usage by project and model
  • Create billing budgets or spend caps for paid projects
  • Review automated scripts that may retry too often

Be careful with automatic retries after a 429 response. An application that retries immediately in a fast loop may keep hitting the same limit. Use a delay and follow any retry guidance returned by the API.

Final Thoughts

Use /stats model to check Gemini CLI token usage and model quota. For Gemini API activity, open Google AI Studio and go to Dashboard > Usage. Developers can read usage_metadata for per-request tokens, while paid costs appear in AI Studio Billing or Google Cloud Billing Reports.

If two screens show different numbers, check your authentication method and selected project first. That’s usually where the confusion begins.