Gemini API returns HTTP 403 for generateContent — request for project access review

Subject: Gemini API returns HTTP 403 for generateContent — Project access appears restricted

Hello Google Gemini API Support Team,

I am experiencing a persistent HTTP 403 error when calling the Gemini API from my project.

Project information

  • Project name: Acharchy

  • Project ID: acharchy

  • Project number: 4275403225..

  • API: Gemini API / Generative Language API

  • Model: gemini-2.5-flash

  • Billing tier: Free tier

Problem

The following API request consistently returns HTTP 403:

POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent

The response is an HTML Google 403 page containing:

Your client does not have permission to get URL /v1beta/models/gemini-2.5-flash:generateContent from this server.

This is not a typical JSON Gemini API error response.

Tests performed

  1. The same project works successfully in Google AI Studio.
    A test prompt returns exactly:

ACHARCHY_GEMINI_OK

  1. The same API request from my WordPress/PHP server returns HTTP 403.

  2. A direct PHP cURL request from the same server also returns HTTP 403.

  3. I tested the same API request from a separate Windows computer using PowerShell and received the same HTTP 403 response.

  4. I also tested:

GET https://generativelanguage.googleapis.com/v1beta/models

from the server, and it also returned HTTP 403.

Therefore, the problem does not appear to be related to WordPress, PHP, cURL, SSL, or the server’s HTTP client.

Authentication and project configuration

  • The API key is a newly created Gemini API authorization key.

  • The key is restricted to the Gemini API.

  • The key is associated with the Acharchy project.

  • The key is bound to the service account:
    acharchy-gemini@acharchy.iam.gserviceaccount.com

  • The service account is enabled.

  • The Gemini API is enabled for the project.

  • The project does not show API access is restricted.

  • The project does not show Project quota tier unavailable.

  • Rate limits do not show a restricted or unavailable project status.

  • Age verification has been completed.

  • Phone verification has been completed.

  • 2-Step Verification is enabled.

No API key or secret credentials are included in this report for security reasons.

Request

Could you please check the backend access/eligibility status of project acharchy and determine why requests to the Gemini API generateContent endpoint are being rejected with HTTP 403 while the same project works in Google AI Studio?

In particular, please verify whether there is any project-level, account-level, API-access, or eligibility restriction that is not visible in the Google Cloud Console or Google AI Studio UI.

Thank you.

Hello @Sajad_khademi ,

Once age, phone and 2sv are configured, retry your request or create a new API key in Google AI Studio.

.If completing these steps still does not restore access (or if using a model requiring a paid tier), you might want to consider adding prepayment credits directly in Google AI Studio and/ or attaching a Google Cloud Billing account in the Google Cloud Console. Please note this will mean you lose your free tier quota.