Skip to main content
Docs/Google Vertex AI

Google Vertex AI Setup Guide

Complete guide to configure Google Cloud Vertex AI as the AI provider for the Vensa Virtual Try-On plugin on WordPress and Magento.

What You'll Need

  • A Google account (Gmail)
  • A credit/debit card for Google Cloud billing (free $300 credit available)
  • Vensa Virtual Try-On plugin installed and license activated
  • ~10 minutes to complete the setup

Pricing

Google Cloud offers a $300 free credit for new accounts (valid for 90 days). After that, Vertex AI image generation costs approximately $0.020 per image at 512x512 resolution. For most stores, this means 1,000 try-ons cost ~$20.

Part 1: Google Cloud Setup

1

Create a Google Cloud Account

  • Go to https://cloud.google.com and click Get started for free.
  • Sign in with your Google account (or create one).
  • Enter billing information — Google offers a $300 free trial credit for new accounts.
  • Accept the terms of service and complete the registration.
2

Create a New Project

  • Open the Google Cloud Console at https://console.cloud.google.com.
  • Click the project dropdown at the top bar → New Project.
  • Enter a project name, e.g. vensa-tryon or my-store-ai.
  • Select your billing account and click Create.
  • Wait a few seconds, then select your new project from the dropdown.
3

Enable the Vertex AI API

  • In the Cloud Console, go to APIs & Services → Library.
  • Search for Vertex AI API.
  • Click on it, then click Enable.
  • Wait for the API to be enabled (this may take a minute).
4

Create a Service Account

  • Go to IAM & Admin → Service Accounts.
  • Click + Create Service Account.
  • Service account name: vensa-tryon (or any name you prefer).
  • Click Create and Continue.
  • In the Grant this service account access to project step, add the role: Vertex AI User (roles/aiplatform.user).
  • Click ContinueDone.
5

Generate a JSON Key

  • In the Service Accounts list, click on the account you just created.
  • Go to the Keys tab.
  • Click Add Key → Create new key.
  • Select JSON format and click Create.
  • A JSON file will be downloaded to your computer — keep this file safe, it contains your credentials.
  • You will need the values from this JSON file in the next step.

Your JSON Key File

The downloaded JSON file will look similar to this. You need 3 values highlighted below:

{
  "type": "service_account",
  "project_id": "your-project-id",       ← Project ID
  "private_key_id": "abc123...",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...",  ← Private Key
  "client_email": "vensa@proj.iam...",    ← Service Account Email
  "client_id": "123456789",
  ...
}

Security: Never share this JSON file publicly or commit it to version control. Store it securely and only paste the values into your WordPress/Magento admin panel.

Part 2: Plugin Configuration

Choose your platform below and follow the steps to connect Vertex AI.

WordPress / WooCommerce

6

Configure in WordPress

  • Go to WooCommerce → Virtual Try-On → AI Settings in your WordPress admin.
  • Select Google Vertex AI as the AI Provider.
  • Enter your Google Cloud Project ID (found in the JSON key file as project_id).
  • Enter the Service Account Email (found in the JSON key file as client_email).
  • Paste the Private Key (found in the JSON key file as private_key — include the BEGIN/END lines).
  • Select the Region closest to your customers (e.g. us-central1, europe-west4, asia-southeast1).
  • Click Save Settings and then Test Connection to verify.
7

Choose a Model & Configure

  • In the AI Settings, under Model Configuration:
  • Model: Select imagegeneration@006 (recommended) or a newer version if available.
  • Image Resolution: Choose 512x512 for faster processing or 1024x1024 for higher quality.
  • Processing Timeout: Set to 30 seconds (default) — increase for slower connections.
  • Click Save Settings.

Magento / Adobe Commerce

6

Configure in Magento

  • Go to Stores → Configuration → Vensa → Virtual Try-On → AI Provider.
  • Select Google Vertex AI as the provider.
  • Enter your Google Cloud Project ID (from the JSON key: project_id).
  • Enter the Service Account Email (from the JSON key: client_email).
  • Paste the Private Key (from the JSON key: private_key — include the BEGIN/END lines).
  • Select the Region (e.g. us-central1, europe-west4, asia-southeast1).
  • Click Save Config.
  • Run: bin/magento cache:flush to apply changes.
7

Choose a Model & Configure

  • In the AI Provider section, under Model Settings:
  • Model: Select imagegeneration@006 (recommended).
  • Image Resolution: 512x512 (fast) or 1024x1024 (high quality).
  • Request Timeout: 30 seconds (default).
  • Click Save Config then flush cache.

Recommended Regions

Choose the region closest to your customers for the fastest processing times:

RegionLocationBest For
us-central1Iowa, USABest for North America
europe-west4NetherlandsBest for Europe
asia-southeast1SingaporeBest for Southeast Asia
asia-northeast1Tokyo, JapanBest for East Asia
australia-southeast1SydneyBest for Oceania

Troubleshooting

"Permission denied" error

Ensure the service account has the Vertex AI User role. Go to IAM & Admin → IAM, find your service account, and verify the role.

"API not enabled" error

Go to APIs & Services → Library, search for Vertex AI API, and click Enable.

"Invalid private key" error

Make sure you copied the entire private key including -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines.

Slow processing times

Select a region closer to your customers. Also consider using 512x512 resolution instead of 1024x1024.

"Quota exceeded" error

You've hit the free-tier limit. Go to IAM & Admin → Quotas to request an increase, or upgrade your billing plan.

Security Best Practices

  • Never share your JSON key file or private key publicly.
  • Use the principle of least privilege — only assign the Vertex AI User role, not Owner or Editor.
  • Set up billing alerts in Google Cloud to avoid unexpected charges.
  • Rotate your service account keys periodically (every 90 days recommended).
  • Restrict the service account's API access to only Vertex AI if possible.