How to beginner · 3 min read

How to enable Vertex AI API

Quick answer
To enable the Vertex AI API, go to the Google Cloud Console, select your project, and enable the Vertex AI API from the API Library. Alternatively, use the gcloud services enable aiplatform.googleapis.com command to enable it via CLI.

PREREQUISITES

  • Google Cloud account
  • Google Cloud project created
  • gcloud CLI installed and configured
  • Python 3.8+ (for SDK usage)
  • pip install google-cloud-aiplatform

Setup

Before enabling the Vertex AI API, ensure you have a Google Cloud project and the gcloud CLI installed and authenticated. Install the Vertex AI Python SDK with pip install google-cloud-aiplatform.

bash
pip install google-cloud-aiplatform

Step by step

Enable the Vertex AI API using the Google Cloud Console or the gcloud CLI. Then verify the API is enabled.

bash
### Enable Vertex AI API via gcloud CLI
# Set your project ID
PROJECT_ID="your-project-id"

# Enable the Vertex AI API
gcloud services enable aiplatform.googleapis.com --project=$PROJECT_ID

# Verify the API is enabled
gcloud services list --enabled --project=$PROJECT_ID | grep aiplatform.googleapis.com
output
aiplatform.googleapis.com

Common variations

You can enable the API via the Google Cloud Console by navigating to APIs & Services > Library, searching for Vertex AI API, and clicking Enable. For Python SDK usage, initialize the client after enabling the API.

python
from google.cloud import aiplatform

# Initialize the Vertex AI client
client = aiplatform.gapic.PipelineServiceClient()
print("Vertex AI client initialized successfully.")
output
Vertex AI client initialized successfully.

Troubleshooting

  • If you get a PERMISSION_DENIED error, ensure your Google Cloud IAM user or service account has the roles/aiplatform.user or equivalent permissions.
  • If the API does not appear enabled, double-check the project ID and that you have billing enabled on your project.

Key Takeaways

  • Enable the Vertex AI API via Google Cloud Console or gcloud CLI before using the SDK.
  • Use the command gcloud services enable aiplatform.googleapis.com to enable the API programmatically.
  • Ensure your IAM permissions include access to Vertex AI services to avoid authorization errors.
Verified 2026-04
Verify ↗