migration vertexai => genai

Hi,

i made the migration following this vertexai to genai.

It went well, but know i am receiving this error : {“name”:“ApiError”,“status”:403} even if i had in the GoogleGenAi config options : vertexai: true.

new GoogleGenAI({
  vertexai: true,
  project: vertexAiCredentials.project_id,
  googleAuthOptions: {
    credentials: vertexAiCredentials,
  },
});

Should i update something in the console admin ( updating credentials or something ?) I can’t figure out why the request is being denied.

Thank for your help,

Titouan

return new GoogleGenAI({
  vertexai: true,
  project: vertexAiCredentials.project_id,
  location: 'global',
  googleAuthOptions: {
    credentials: vertexAiCredentials,
  },
});

I was missing the location attribute. It’s optional but it seems to be mandatory for the call to work.