Hi everyone,
I'm trying to access Gemini models (e.g. `gemini-pro`) via the Vertex AI API in a Google Cloud project. I’m using a service account with proper credentials, and everything is set up correctly, including authentication and region (`europe-west4`).
However, I consistently get this error:
Client error: `POST https://europe-west4-aiplatform.googleapis.com/v1/projects/gemini-dsgvo/locations/europe-west4/publi...` resulted in a `400 Bad Request` response: { "error": { "code": 400, "message": "Project `XXX the project number XXXX` is not allowed to use Publisher Model `projects/g (truncated...)
Hello @Leonardo1970,
To resolve your Gemini API 400 error, first verify your project has explicit access to Gemini models, as some require allowlisting. Ensure your service account has the Vertex AI User role and confirm billing is active. Double-check the model path format (publishers/google/models/gemini-pro) and test in us-central1 if regional availability is an issue.
Please try to confirm the configs below:
I hope the above answer helped! If problems persist, contact Google Cloud support with the full error for project-specific enablement.
Best regards,
Suwarna
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |