Connect to Google Vertex AI
Connect to Google Vertex AI and use Gemini models for AI-powered apps and automations in Retool.
| Google Vertex AI Availability | |||
|---|---|---|---|
| Cloud | Generally Available | ||
This change is available to cloud instances that use the updated AI resource management.
Google Vertex AI is Google Cloud's managed AI platform that provides access to the Gemini family of multimodal models within your own GCP infrastructure. Unlike the Gemini API accessed via Google AI Studio, Vertex AI runs inside your GCP project, giving you enterprise-grade security, data residency, and IAM-based access management. You can create a Google Vertex AI resource to build AI-powered apps and workflows that leverage Gemini's capabilities for text generation, data analysis, and image understanding.
What you can do with Google Vertex AI
With a Google Vertex AI resource, you can interact with LLMs to perform various actions, including:
- Generate, summarize, and classify text.
- Generate chat responses.
- Generate text from images or caption images.
Learn more in the action types section.
Supported models
Google Vertex AI resources require you to bring your own key for authentication. Retool-managed keys are not currently supported.
The following models are available with your own API key:
| Model | Resource queries | Agent support |
|---|---|---|
| Gemini 2.5 Flash | ||
| Gemini 2.5 Pro |
Specify the model ID in your queries. Refer to Google's Vertex AI model documentation for the complete list of available model versions.
Before you begin
Before creating a Google Vertex AI resource, you need:
- Retool permissions: Ability to create and manage resources in your Retool organization.
- Google Cloud project: An active GCP project with the Vertex AI API enabled.
- Service account: A Google Cloud service account with the Vertex AI User role (
roles/aiplatform.user) or equivalent permissions. - Service account JSON key: A downloaded JSON key file for the service account.
Create a Google Vertex AI resource
Create a resource to connect Retool to Google Vertex AI and configure authentication. Once connected, you can select it when writing queries to interact with Gemini models.
Follow these steps to create a Google Vertex AI resource in Retool.
1. Create a new resource
Navigate to Resources in the main navigation and click Create new > Resource and search for Google Vertex AI. Then, click the Google Vertex AI tile to create a new resource.
2. Configure connection settings
Specify a name for the resource that identifies it within your organization. Include a description to provide context to users and Assist about how to use the resource.
3. Configure authentication
This resource requires a Google Cloud service account. Retool-managed keys are not available for Google Vertex AI.
Google Vertex AI resources authenticate using a Google Cloud service account JSON key.

Project ID
Your Google Cloud project identifier (e.g., my-gcp-project). This is the project where the Vertex AI API is enabled.
Location
The GCP region where your Vertex AI requests are processed. Select a region close to your users or data for lower latency. The default is us-central1. Refer to Google's locations documentation for the full list of supported regions.
Service account key
Paste the full contents of your Google Cloud service account JSON key file. Retool uses this key to authenticate requests to the Vertex AI API.
To generate a service account key:
- Open the Service accounts page in Google Cloud Console.
- Select your project and find or create a service account with the Vertex AI User role.
- Click the service account, open the Keys tab, and click Add key > Create new key.
- Select JSON and download the key file.
- Open the file and paste its entire contents into the Service account key field.
Create a service account specifically for Retool with only the permissions it requires. All credentials are encrypted and stored securely.
4. Save the resource
Click Create resource to save your Google Vertex AI resource. The resource is now available for use in apps and workflows.
AI resources do not have a Test connection button. Verify your configuration by creating a query and running it in your app or workflow.
Query Google Vertex AI data
Create queries against your Google Vertex AI resource to interact with Gemini models in your Retool apps and workflows.
Create a query
In your Retool app or workflow, create a new query and select your Google Vertex AI resource from the resource dropdown. Choose an action type to configure what you want Gemini to do.
Action types
With a Google Vertex AI resource, you can interact with LLMs to perform various actions, including:
Text actions
| Action | Description |
|---|---|
| Generate text | Create original text content based on your prompt. Use for content generation, creative writing, code generation, and general-purpose text tasks. |
| Summarize text | Condense long-form content into concise summaries. Specify the input text and desired summary format. |
| Classify text | Categorize text into predefined categories. Provide the text to classify and the possible categories. |
| Extract entity from text | Extract specific information from unstructured text. Define what entities or data points to extract (names, dates, amounts, etc.). |
Chat actions
| Action | Description |
|---|---|
| Generate chat response | Create contextual responses in multi-turn conversations. The AI model considers previous messages to maintain conversation flow. |
Image actions
| Action | Description |
|---|---|
| Generate text from image | Analyze images and generate descriptive text. Upload an image or provide an image URL, then ask questions or request analysis. |
| Caption image | Generate descriptive captions for images. Provide an image and optionally specify the caption style or focus. |
Configuration options
You can configure the following options when querying a Google Vertex AI resource.
| Option | Description | Example |
|---|---|---|
| Model | The Gemini model to use. Different models offer different capabilities, speeds, and costs. Refer to Supported models for available options. | gemini-2.5-flash |
| Temperature | Determines the randomness in responses. Accepts a decimal number between 0.0 and 2.0. Lower values (0.0–0.3) are more focused and deterministic. Medium values (0.4–0.7) are balanced. Higher values (0.8–2.0) are more creative. Not all models support temperature control. If you select a model that does not use this option, Retool removes it from the query editor. | 0.6 |
| System message | Provides instructions for the model's behavior. Use it to define the model's role, response format, or domain expertise. The system message applies to all interactions in the query. | You are a data analysis expert. Provide concise, structured insights with clear recommendations. |
| Prompt | The main input or question for Gemini. Can use {{ }} dynamic expressions to reference component values or query data. | Analyze this feedback and summarize the key themes: {{ feedbackTextarea.value }} |
Common use cases
The following examples demonstrate typical Google Vertex AI integrations in Retool apps.
Analyze product images for quality control
Use Gemini's vision capabilities to automate product inspection workflows.
Query example
| Setting | Value |
|---|---|
| Model | gemini-2.5-flash |
| Temperature | 0.2 |
You are a quality control inspector. Analyze product images and identify defects, damage, or quality issues. Return a JSON object with your findings.
Analyze this product image and return JSON with:
- quality_score (1-10)
- defects_found (array of strings, empty if none)
- pass_fail (boolean)
- notes (string)
{{ fileInput.value[0].base64 }}
Use this query with a File Input component for image upload and a Text component to display inspection results.
Extract structured data from documents
Parse invoices, reports, or forms and load the extracted data into your database.
Query example
| Setting | Value |
|---|---|
| Model | gemini-2.5-pro |
| Temperature | 0.1 |
Extract structured information from documents and return ONLY valid JSON with no additional text or explanation.
Extract the following from this document and return as JSON:
- document_type
- date
- entity_name
- total_amount
- line_items (array of {description, quantity, unit_price})
Document:
{{ documentTextarea.value }}
Use a JavaScript transformer to process the JSON response and pass it to a write query that inserts the data into your database.
Classify and route support tickets
Automatically categorize incoming support requests and assign them to the right team.
Query example
| Setting | Value |
|---|---|
| Model | gemini-2.5-flash |
| Temperature | 0.1 |
You are a support ticket classifier. Analyze requests and return a JSON object with: category (one of: billing, technical, account, general), priority (low/medium/high), and suggested_team (one of: finance, engineering, account-management, support).
Classify this support ticket:
Subject: {{ subjectInput.value }}
Body: {{ bodyTextarea.value }}
Chain this query with a database write query to automatically update the ticket's category and routing in your support system.
Generate reports from operational data
Summarize datasets into structured reports for review and sharing.
Query example
| Setting | Value |
|---|---|
| Model | gemini-2.5-pro |
| Temperature | 0.4 |
You are a business analyst. Analyze operational data and produce concise summaries with key metrics, trends, and recommendations. Format your response in markdown.
Generate a summary of the following data. Include top-line metrics, notable trends, and 3 actionable recommendations.
Data:
{{ JSON.stringify(dataQuery.data) }}
Display the generated report in a Rich Text Editor component to allow editing before sharing.