Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Suddenly receving an "Error: ClientError: [VertexAI.ClientError]: got status: 400 Bad Request" error

Hello,

Today, I suddenly started receiving errors from my Firebase function that uses Vertex AI with the Gemini 1.5 Flash model.

The error I'm receiving:
Error: ClientError: [VertexAI.ClientError]: got status: 400 Bad Request. {"error":{"code":400,"message":"Project `PROJECT_ID` is not allowed to use Publisher Model `projects/PROJECT_NAME/locations/us-central1/publishers/google/models/gemini-1.5-flash`","status":"FAILED_PRECONDITION"}}

I haven't changed any part of the code or made any modifications to Google Cloud. I've been using the same code and settings for over six months.

I would appreciate any help with this issue, as I haven't been able to find any relevant information.

Note:
Vertex AI is enabled in Google Cloud, and both Vertex AI Administrator and Vertex AI User roles are assigned to the service account that Firebase uses.

0 1 136
1 REPLY 1

Hi Candeh,

Welcome to the Google Cloud Community!

The error message 400 indicates that your project is no longer authorized to use the gemini-1.5-flash model. Here are a few possible solutions that might help resolve the issue: 

  • Google Cloud's model availability and access policies may change, you may review the official Vertex AI release notes for any updates on the Gemini 1.5 Flash model.
  • Although you've assigned the necessary roles, there could be permission issues; you may want to try creating a new service account with the required permissions and updating your Firebase functions.
  • Make sure the model is deployed in the correct region (us-central1 in your case) and that your project is set up to use this region. A misconfiguration here can lead to access errors.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.