Persistent 404 Error Accessing Any Vertex AI Model Across Multiple Projects

Hello everyone,

I’m facing a persistent and perplexing issue where I am unable to make any successful API calls to Vertex AI’s generative models from my account.

1. Detailed Issue:

Every attempt to call model.generate_content() results in the following 404 error, regardless of the model or the specific project I use:

404 Publisher Model `projects/[PROJECT-ID]/locations/us-central1/publishers/google/models/gemini-1.0-pro` was not found or your project does not have access to it.

The most unusual part is that this error occurs consistently across three separate projects, including a brand new one created specifically for testing and isolation. This suggests the issue is not with a specific project’s configuration but possibly with my Google Cloud account itself.

2. What I’ve Already Tried (Exhaustive List):

We have systematically ruled out all common causes for this error:

  • IAM Permissions: I have granted the necessary service accounts the Vertex AI User, Vertex AI Admin, and even the Owner roles. The error persists in all cases.

  • Billing Account: I have confirmed that my linked billing account is Active, in good standing, and has recent charges from other services. There are no holds, warnings, or outstanding issues on the billing account.

  • API Enablement: The Vertex AI API is enabled in all tested projects. I have also tried the cycle of disabling the API, waiting several minutes, and then re-enabling it. This did not solve the issue.

  • Multiple Models: The error is model-agnostic. I have tested with gemini-1.5-pro, gemini-1.5-flash, and gemini-1.0-pro, and all of them return the same 404 error.

  • Clean Project & Isolation Test: I created a brand new project from scratch (gen-lang-client-0399570822 and biblia-453315). In this new project, I:

    1. Linked the active billing account.

    2. Enabled the Vertex AI API.

    3. Created a completely new service account.

    4. Granted this new service account only the Vertex AI User role.

    5. Downloaded a new JSON key. The error still occurs even in this perfectly clean environment.

3. Relevant Code (Minimal Reproducible Script):

To rule out any issues with my main application, I have been using the following minimal, self-contained Python script. This script reliably reproduces the error every time it is run against any of my projects.

Python

import vertexai
from vertexai.generative_models import GenerativeModel
import os

# --- CONFIGURATION ---
# The script has been tested with multiple project IDs and their corresponding keys.
# Example:
PROJECT_ID = "biblia-453315" 
CREDENTIALS_FILE = "C:/path/to/my/biblia-453315-19846ac1c818.json"
# --- END CONFIGURATION ---

LOCATION = "us-central1"
MODEL_NAME = "gemini-1.0-pro" # Using a stable model for testing

try:
    print("--- Starting minimal test ---")
    os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = CREDENTIALS_FILE
    print(f"Credentials set to: {os.environ.get('GOOGLE_APPLICATION_CREDENTIALS')}")

    vertexai.init(project=PROJECT_ID, location=LOCATION)
    print(f"Vertex AI initialized for project '{PROJECT_ID}' in location '{LOCATION}'")

    model = GenerativeModel(model_name=MODEL_NAME)
    print(f"Model '{MODEL_NAME}' loaded.")

    prompt = "What is the capital of France?"
    print(f"Sending prompt: '{prompt}'")

    response = model.generate_content(prompt)
    print("--- SUCCESS! ---")
    print("AI Response received:")
    print(response.text)

except Exception as e:
    print("--- FAILURE! ---")
    print(f"An error occurred: {e}")

Given that all standard project-level and code-level configurations appear to be correct, I am at a loss. Has anyone ever encountered a situation where an entire account seems unable to access Vertex AI services? Could this be related to a higher-level account restriction, a backend provisioning issue, or something else entirely?

Any insights or suggestions for what to investigate next would be greatly appreciated.

Hello, I have a critical update which confirms a platform-level issue.

My last tests show a direct contradiction between the Google Cloud Console UI and the API behavior:

  1. For Project gen-lang-client-0399570822: The IAM console page confirms that the service account has the Vertex AI Administrator role. However, the API call fails with a 403 IAM_PERMISSION_DENIED error. (UI is correct, API behavior is wrong).

  2. For Project teste-ia-414922: The API console page confirms that the “Vertex AI API” (aiplatform.googleapis.com) is Enabled. However, the API call fails with a 403 CONSUMER_INVALID error, which indicates the API is disabled. (UI is correct, API behavior is wrong).

This proves the issue is not a user configuration error but a backend problem with my account’s state, where the configurations shown in the UI are not being honored by the API.

I am completely blocked. Please escalate this issue for internal investigation. Thank you.

@Lenilson : Gemini 1.0/1.5 models (e.g.gemini-1.5-pro, gemini-1.0-pro) are not longer available for new projects/users. Please see this page for the latest available models: https://cloud.google.com/vertex-ai/generative-ai/docs/models

Hi @Lenilson,

Welcome to the Google Cloud Community!

In addition to @ericdong, Based on the documentation:

Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.

If you continue to run into issues, consider reaching out to Google Cloud Support to further check underlying issues. When you contact them, be sure to provide as much detail as possible and include screenshots. This will help them understand your problem better and get it sorted out more quickly.

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.