keyartificial-intelligencegoogle-gemini

Gemini API keys usage per API key


Currently, I'm using the API key separately for each client. I have no idea how to know the usage cost for each API key.

I want to know the usage cost per API key for generating the invoice for clients. Is there any idea to know it?


Solution

  • You can see your billing for the Gemini API in the Google Cloud Console's API metrics section (that deep links to the Gemini API specifically).

    On that page, there's a "credentials" dropdown, where you can select the credentials(s) you're interested in by the name you gave them, as well as by type (API key, service account, oauth, etc).

    screenshot of GLAPI metrics with credential selector open

    There is also a table at the bottom of the page that shows the number of requests, in case that gives you the specificity you need. AFAIK the actual Cost report does not break down to that level of granularity, for that you would need to break out into separate projects.