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
Create a Google Cloud Account
- Go to
https://cloud.google.comand clickGet started for free. - Sign in with your Google account (or create one).
- Enter billing information — Google offers a
$300 free trial creditfor new accounts. - Accept the terms of service and complete the registration.
Create a New Project
- Open the
Google Cloud Consoleathttps://console.cloud.google.com. - Click the project dropdown at the top bar →
New Project. - Enter a project name, e.g.
vensa-tryonormy-store-ai. - Select your billing account and click
Create. - Wait a few seconds, then select your new project from the dropdown.
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).
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 projectstep, add the role:Vertex AI User(roles/aiplatform.user). - Click
Continue→Done.
Generate a JSON Key
- In the Service Accounts list, click on the account you just created.
- Go to the
Keystab. - Click
Add Key → Create new key. - Select
JSONformat and clickCreate. - 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
Configure in WordPress
- Go to
WooCommerce → Virtual Try-On → AI Settingsin your WordPress admin. - Select
Google Vertex AIas the AI Provider. - Enter your
Google Cloud Project ID(found in the JSON key file asproject_id). - Enter the
Service Account Email(found in the JSON key file asclient_email). - Paste the
Private Key(found in the JSON key file asprivate_key— include the BEGIN/END lines). - Select the
Regionclosest to your customers (e.g.us-central1,europe-west4,asia-southeast1). - Click
Save Settingsand thenTest Connectionto verify.
Choose a Model & Configure
- In the AI Settings, under
Model Configuration: Model: Selectimagegeneration@006(recommended) or a newer version if available.Image Resolution: Choose512x512for faster processing or1024x1024for higher quality.Processing Timeout: Set to30 seconds(default) — increase for slower connections.- Click
Save Settings.
Magento / Adobe Commerce
Configure in Magento
- Go to
Stores → Configuration → Vensa → Virtual Try-On → AI Provider. - Select
Google Vertex AIas 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:flushto apply changes.
Choose a Model & Configure
- In the AI Provider section, under
Model Settings: Model: Selectimagegeneration@006(recommended).Image Resolution:512x512(fast) or1024x1024(high quality).Request Timeout:30seconds (default).- Click
Save Configthen flush cache.
Recommended Regions
Choose the region closest to your customers for the fastest processing times:
| Region | Location | Best For |
|---|---|---|
us-central1 | Iowa, USA | Best for North America |
europe-west4 | Netherlands | Best for Europe |
asia-southeast1 | Singapore | Best for Southeast Asia |
asia-northeast1 | Tokyo, Japan | Best for East Asia |
australia-southeast1 | Sydney | Best 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.