How to control costs when using gemini-2.5-pro

I am using LLM across different google products, and Firebase Studio is one of them. I work very often with gemini-2.5-pro in Firebase Studio. Sometimes the cost “explode” when i work intensively to complete a feature.

  1. Can i control somewhere, what the costs ocurred just in Studio are? Could i at least check the token count in Studio? Is there a terminal command to access that?
  2. Can I clear the context window, so that token cost is lower (when i think large context is not necessary anymore for a certain task). I think there is a “clear” command?

Yep, we have documentation around cost monitoring here: Monitor costs, usage, and other metrics  |  Firebase AI Logic Please check it out!

I tried to set a budget inside the console for Firebase Studio but I understood it was for my project. This seems as it it is not.

I set a budget of $25.

I got a bill for $307 for the month.

I feel utterly deceived and swindled by Google.

I don’t not think they make it clear anywhere that thisis some unenforce random statement rather than an enforced budget limit.

Good luck.

Jono