Input/output tokens telemetry/usage metrics

I ran my program that consumes Gemini API and trying to understand how many input and output tokens I consumed. Where can I see these metrics?

The easiest way to do this is to use the usage_metadata assocaited with the api call which can be used to retrieve the input and/or the combined input/output tokens. See here:

1 Like