Skip to content

Setup & Configuration

jorsm edited this page May 31, 2026 · 6 revisions

Setup & Configuration

Configure the extension with your Google Cloud project and usage preferences.

Table of Contents

Key settings

All settings use the vertexAiChat namespace.

Setting Type Default Description
vertexAiChat.projectId string "" Required. The GCP Project ID used for Vertex AI authentication and model discovery. Supports resource-aware scoping.
vertexAiChat.retryMaxDurationMinutes integer 30 Maximum retry duration for transient API failures such as 429 or 503.
vertexAiChat.hideBillingWarning boolean false Hide the estimated cost warning banner in the usage dashboard.
vertexAiChat.enableUserLabel boolean false Opt in to add a vscode-vertex-ai-user label to requests. Note: Only supported for Gemini and MaaS models.
vertexAiChat.userLabelValue string "" Optional. Custom value for the user label. If empty, derived from active identity.
vertexAiChat.enableProjectLabel boolean false Opt in to add a vscode-vertex-ai-project label to requests. Note: Only supported for Gemini and MaaS models.
vertexAiChat.projectLabelValue string "" Optional. Custom value for the project label. If empty, derived from workspace name.

Authentication Methods

The extension supports three ways to authenticate, resolved in this order:

  1. Service Account Selection: A private choice made via the Select Authentication Method command.
  2. Environment Variable: GOOGLE_APPLICATION_CREDENTIALS pointing to a key file.
  3. Application Default Credentials: Standard gcloud auth login.

See Quick Start and Service Account Authentication for more.

Example workspace settings

To keep billing tied to a specific project for a repository, use .vscode/settings.json:

{
  "vertexAiChat.projectId": "my-gcp-project-id"
}

Workspace vs global settings

  • Workspace settings are useful when you switch between multiple projects or clients.
  • Global settings are fine for a single development environment.

Most settings are resource-aware, meaning you can override them at the Workspace Folder level in multi-root workspaces. This is particularly useful for vertexAiChat.projectId and cost attribution labels.

The extension automatically re-runs model discovery when vertexAiChat.projectId changes.

Automatic configuration migration

If you previously used the older vertexAnthropic configuration namespace, the extension automatically migrates vertexAnthropic.projectId and vertexAnthropic.hideBillingWarning into vertexAiChat.

Retry behavior

vertexAiChat.retryMaxDurationMinutes controls how long the extension will retry transient API failures before failing the request. This helps reduce interruptions from temporary rate limits or service unavailability.

Recommended settings

  • Set vertexAiChat.projectId in the workspace when working across multiple Google Cloud projects.
  • Keep enableUserLabel and enableProjectLabel off unless your organization wants cost attribution labels.
  • Use hideBillingWarning=true only after you understand that the dashboard uses estimated costs, not invoice totals.

Clone this wiki locally