I am using the pre - paid key of Gemini. I want to write code in advance to capture the error code of the Python program when the pre - paid quota is exceeded. May I ask what error will be reported when the quota is exceeded?
Hi @Pei_Liu
Unfortunately, I have no clue what you mean by “pre-paid” key.
However, you might be interested to check for HTTP 429 and HTTP 503 in the response header. If that is returned, you either wait or swap key and run the request again.
Cheers