Google Gemini API error
Gemini API 403 PERMISSION_DENIED: what it means and how to fix it
403 PERMISSION_DENIEDRetry? NoLast verified 1 documented fix2 sources
What it means
generateContent API: your API key does not have the required permissions.
Causes
- Using the wrong API key
- Using a tuned model without going through proper authentication
How to fix it
- Fix 1.
Check that your API key is set and has the right access, and go through proper authentication to use tuned models.
More Gemini API errors
All 30 Gemini API errorsHTTP 403 at other providers
Compare 403 across providers403 AccessDeniedExceptionRetry? NoAmazon Bedrock403 InvalidClientTokenIdRetry? Not statedAmazon Bedrock403 MPAgreementBeingCreatedRetry? YesAmazon Bedrock403 AWS Marketplace Agreement Failed within 15 minutesRetry? Not statedAmazon Bedrock403 AWS Marketplace Agreement Pending after 15 minutesRetry? YesAmazon Bedrock403 permission_errorRetry? Not statedAnthropic API403 Forbidden (network access denied)Retry? Not statedAzure OpenAI403 Forbidden (resource has been temporarily blocked)Retry? Not statedAzure OpenAI403 ForbiddenRetry? Not statedGroq API403 ForbiddenRetry? Not statedMistral API403 Country, region, or territory not supportedRetry? Not statedOpenAI API403 PermissionDeniedErrorRetry? Not statedOpenAI API
FAQ
What does the Gemini API error "403 PERMISSION_DENIED" mean?
generateContent API: your API key does not have the required permissions.
How do I fix Gemini API "403 PERMISSION_DENIED"?
Check that your API key is set and has the right access, and go through proper authentication to use tuned models.
Should I retry Gemini API "403 PERMISSION_DENIED"?
No. The official docs treat this error as not retryable: fix the cause before sending the request again.
Which other AI APIs return HTTP 403?
Per their official error docs: Amazon Bedrock (403 AccessDeniedException; 403 InvalidClientTokenId; 403 MPAgreementBeingCreated; 403 AWS Marketplace Agreement Failed within 15 minutes; 403 AWS Marketplace Agreement Pending after 15 minutes), Anthropic API (403 permission_error), Azure OpenAI (403 Forbidden (network access denied); 403 Forbidden (resource has been temporarily blocked)), Groq API (403 Forbidden), Mistral API (403 Forbidden), OpenAI API (403 Country, region, or territory not supported; 403 PermissionDeniedError), OpenRouter (403 permission_denied; 403 Budget limit exceeded; 403 content_policy_violation; 403 refusal), Vertex AI (403 PERMISSION_DENIED), xAI API (403 Forbidden).
Sources
Last verified against 2 sources: Gemini API's official docs and official SDK repositories.
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.