Hi,
I’m trying to call Gemini models via the Vertex AI publisher path from Node.js using @google/genai in a new Google Cloud Free Trial project.
Project ID: project-25aefaf5-407a-4431
Region: global (also tried us-central1)
Account: New Google Cloud Free Trial (Germany), free credits are active and billing is attached to this project.
Code:
js
const { GoogleGenAI } = require(‘@google/genai’);
const ai = new GoogleGenAI({
vertexai: true,
project: ‘project-25aefaf5-407a-4431-9f0’,
location: ‘global’
});
ai.models.generateContent({
model: ‘gemini-1.5-flash’,
contents: ‘Sag Hallo auf Deutsch’
}).then(r => console.log(r.text)).catch(e => console.error(e));
Error:
text
ApiError: {“error”:{“code”:404,“message”:“Publisher Model projects/project-25aefaf5-407a-4431-9f0/locations/global/publishers/google/models/gemini-1.5-flash was not found or your project does not have access to it. Please ensure you are using a valid model version.”,“status”:“NOT_FOUND”}}
What I already did:
Enabled Vertex AI API (aiplatform.googleapis.com) for this project.
Attached the free-trial billing account to the project.
Set up Application Default Credentials with gcloud auth application-default login and gcloud auth application-default set-quota-project project-25aefaf5-407a-4431-9f0.
Verified that ADC works for other APIs.
Tried both location: ‘global’ and location: ‘us-central1’.
Created a completely new Google account + trial + project with no organization. Same 404.
It looks like my project simply doesn’t have access to the Gemini publisher models, even though billing and Vertex AI API are enabled.
Could someone from the team please check if Gemini access needs to be enabled/allowlisted for this project, or if there is a known issue with new trial projects and the Vertex AI publisher models?
Thanks!