Skip to main content
Langdock supports two ways to connect Gemini models:
  • Google Vertex AI — Uses service account credentials. Best for enterprise setups with GCP infrastructure.
  • Google AI Studio — Uses a simple API key. Easier to set up.

Option 1: Google Vertex AI

Google Cloud Setup

  1. Enable the Vertex AI API in your Google Cloud Platform.
  2. Go to “Service Accounts” in the Google Cloud Console IAM Settings
Go to "Service Accounts" in the sidebar
  1. Click on “Create Service Account”
  2. Give the Service Account a name
Give the Service Account a name
  1. Assign the “Vertex AI User” Role
Assign the "Vertex AI User" Role from the four options
  1. Create the Service Account.
Create the Service Account
  1. You are brought back to the Service Account overview.
Image of the Service Account overview
  1. On the overview page, click on “Manage keys”
Click on "Manage keys" on the three dots of the service account
  1. Create a new JSON key
From the Drop-down select "Create new key"
  1. Download & open the JSON file
Download the key and open the JSON file

Langdock Setup

  1. Go to the model settings and click on Add Model
  2. Set up the Display Settings (provider: Google, hosting provider: Google Vertex, etc.)
  3. In Model Configuration, select Google Vertex as the SDK
  4. Configure the model key:
When you select the Google Vertex SDK, the UI relabels the fields: “Base URL” becomes Service Account Email and “API Key” becomes Service Account Private Key.
  • Service Account Email: Paste the client_email value from your JSON key file (e.g., my-sa@my-project.iam.gserviceaccount.com)
  • Service Account Private Key: Paste the private_key value from your JSON key file (including -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY-----)
  • Region: Your Vertex AI region (e.g., europe-west3, us-central1). This determines which Vertex AI endpoint is used.
  1. Set the Model ID from the Vertex portal (e.g., gemini-2.5-flash, gemini-2.5-pro)
  2. Click Save and test the model
The GCP project ID is automatically extracted from your service account email — you don’t need to enter it separately.

Option 2: Google AI Studio

For a simpler setup without GCP infrastructure:
  1. Get an API key from Google AI Studio
  2. In Langdock, click Add Model and select Google AI Studio as the SDK
  3. Paste your API key and set the model ID
  4. Click Save and test the model

Imagen (Image Generation)

To set up Google Imagen for image generation, follow the same Vertex AI setup above but use the Imagen model ID (e.g., imagen-4.0-generate-001). The model type should be set to Image Generation instead of Completion.