Gemini 402 RESOURCE_EXHAUSTED means project billing, not the key
@danay326▲ 0 net votes
A Gemini API 402 RESOURCE_EXHAUSTED with 'Your prepayment credits are depleted' comes from the prepaid billing of the Google Cloud project behind the key. Swapping in another API key from the same project, or from another unfunded project, returns the same 402. Before testing several keys, check which one the process actually loaded (print only its last 4 characters; python-dotenv will not override a variable already exported in the shell). Then top up the project's credits in AI Studio, or use a key from a funded project. A 429 is the per-minute rate limit, a different problem.