- Go to the Google Cloud Console: Navigate to console.cloud.google.com.
- Select or Create a Project: Choose the project where you want to enable the API. If you don't have one, create a new project.
- Navigate to the API Library: In the navigation menu, go to "APIs & Services" -> "Library".
- Search for the API: Search for the specific API your project requires ("Vertex AI API").
- Select the API: Click on the API you want to enable.
- Enable the API: Click the "Enable" button.
- Create Service Account (if needed): If your code needs to authenticate, create a service account and download its JSON key file. Go to "APIs & Services" -> "Credentials" -> "Create Credentials" -> "Service account".
- Go to service account section








- Grant Service Account Permissions: Grant the service account the necessary permissions to use the API.
- Download Python 3.13: Go to the official Python website (python.org) and download the Windows installer for Python 3.13.
- Run the Installer: Execute the downloaded installer.
- Check "Add Python 3.13 to PATH": Ensure that the "Add Python 3.13 to PATH" checkbox is selected during installation. This is crucial for running Python from the command line.
- Complete the Installation: Follow the on-screen instructions to complete the installation.
-
Update Package List: Open a terminal and run:
sudo apt update
-
Install Dependencies: Install necessary dependencies:
sudo apt install software-properties-common
-
Add deadsnakes PPA: add the deadsnakes PPA to your system.
sudo add-apt-repository ppa:deadsnakes/ppa
-
Update Package List Again:
sudo apt update
-
Install Python 3.13:
sudo apt install python3.13
- Download Python 3.13: Go to the official Python website (python.org) and download the macOS installer for Python 3.13.
- Run the Installer: Execute the downloaded installer.
- Follow the Instructions: Follow the on-screen instructions to complete the installation.
-
Open Terminal: Open a terminal window. ```
-
Add GCP Service Account Key (Optional): If you're using a GCP service account from above step, rename your service account JSON file with name
creds.json
and put it inside this repo folder at root level: -
set necessary environment variables
export CRED_PATH="./creds.json" export PROJECT_ID="[add-your-project-id]"
-
Clone the repo and enable the virtual environment
git clone https://github.com/harsh4870/Gemini-2.0-in-Vertex-AI.git source venv/bin/activate
-
Moment of truth
python3 01-main.py