Pricing mechanism

How does the gemini pricing work ? are there some inconsistencies ? I ran a single query with gemini-flash-001-latest, cached token count = 38000, i/p token count = 500, o/p token count = 20. HOwever i was charged roughly 2$ for this query. I measured my total costs before and after this request and estimated 2$.

I have experienced a similar situation where I was charged around $200 when trying out the paid version of Gemini API. Back then my issue was that there was no way I could see my billing updated in real-time, resulting in me trying to execute a bunch of code to see how it calculates, and voila, I was surprised to see the $200 billing.

Would you mind sharing how you saw the $2 charge right after the query?

Did you have any system instructions? If you’re making a chatbot, there’s also memory that adds up and accumulates with each prompt. More explanation is needed on how you’re using it.

I didn’t understand. Within an few hours of the eod, I saw the bill

I realized, I had failed to consider the costs of caching