Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Confusion Regarding Google AI Studio API Pricing

Hi Team,
I am very confused about calculating pricing of the gemini API using AI Studio.
The pricing stated is :
Prompts up to 128k tokens
Input Pricing
$0.075 / 1 million tokens

output Pricing
$0.30 / 1 million tokens

Say , my input is 1000 tokens , Output is 2000 tokens, will I be charged a flat charge of (1000* 0.075) + (2000 * 0.3)  , or will I be charged at a pro-rata basis? 
i.e I pay for only the total token amount I use ?
(1000 * (cost for 1000 input tokens , derived from a million)) + (2000 * (cost for 2000 output tokens , derived from a million)) ?

thanks


0 3 6,157
3 REPLIES 3