Ensure that the model you are requesting is available on your current plan. For example, not all models are available on the free tier. You can verify model availability, quotas, and limits on the AI Studio Rate Limit dashboard.
Once verified, retry your request or create a new API key in Google AI Studio.
Upgrade to a Paid Tier:
If verifying your account does not restore access (or if using a model requiring a paid tier), you can unlock access by adding prepayment credits directly in Google AI Studio or attaching a Google Cloud Billing account in the Google Cloud Console.