AI Provider Setup
Virtual Try On for WooCommerce relies on advanced multimodal AI vision models to perform human model generation, clothing segmentation, and natural drape rendering. This guide explains how to generate and configure API keys for each supported provider.
1. Google Gemini API Setup
Google Gemini offers high-speed image generation and editing models through Google AI Studio.
Steps to Obtain Gemini API Key:
- Navigate to Google AI Studio and sign in with your Google account.
- In the left navigation bar, click on Get API key.
- Click Create API key. You can choose to associate the key with a new Google Cloud project or an existing one.
- Copy the generated API key.
- In your WordPress dashboard, navigate to Webkul WC Addons → Virtual Try On.
- Select Gemini as the AI Provider, paste the key into the Gemini API Key field, and click Refresh.
- Select an available image model (such as
gemini-3.1-flash-imageorgemini-2.5-flash-image) and click Save Configuration.
2. OpenAI API Setup
OpenAI provides powerful vision generation and editing capabilities.
Steps to Obtain OpenAI API Key:
- Go to the OpenAI Platform and log in or create an account.
- In the dashboard sidebar, navigate to API Keys.
- Click Create new secret key.
- Enter a name for the key (e.g.,
WooCommerce Virtual Try On) and set permissions to All or ensure Model read/write permissions are granted. - Copy the secret key immediately (it will not be displayed again).
- In WordPress, open Webkul WC Addons → Virtual Try On, select OpenAI, paste your secret key, click Refresh to discover image models, and click Save Configuration.
3. Alibaba Cloud Qwen (DashScope) Setup
Alibaba Cloud's Qwen image editing models (qwen-image-edit) offer specialized garment fitting and high-fidelity texture replication.
Steps to Obtain Qwen API Key:
- Log into the Alibaba Cloud Model Studio (DashScope Console).
- Under the user menu or API management section, navigate to API-KEY.
- Click Create new API-KEY.
- Copy the key and enter it into the Qwen API Key field in the WordPress settings panel.
- Click Refresh to populate the model list and click Save Configuration.
4. Custom Endpoint Setup
If your organization hosts private image models (e.g., FLUX.1 Fill, Stable Diffusion Inpainting, or custom FastAPI proxies), configure the Custom provider option:
- Host Configuration: Deploy your AI service with an HTTPS endpoint accessible from your web server.
- Select Custom: In Webkul WC Addons → Virtual Try On, choose
Custom. - Set Base URL: Enter your server's root URL (e.g.,
https://ai.yourstore.com/v1). - Specify Model: Enter your deployment's internal model identifier (e.g.,
vton-prod-v1). - Select Format:
OpenAI compatible: Expected payload follows standard/chat/completionsor/images/editsconventions.Gemini compatible: Expected payload follows Google AI Studio format.Qwen (DashScope) compatible: Expected payload follows Alibaba Cloud DashScope task submission schema.
- API Key: If your gateway requires Bearer token authentication, enter it in the optional API Key field.
Security & Billing Best Practices
Protect Your API Credentials
- Never paste API keys in public forums or support tickets.
- Always set monthly budget caps in your Google Cloud, OpenAI, or Alibaba Cloud billing console to prevent unexpected charges during high-traffic sales events.
- To rotate an API key, generate a new key in your provider console first, paste it into WordPress, verify model fetching via Refresh, and save before deleting the old key.
