Skip to main content
This page covers Gemini hosted on Google Vertex AI. For Gemini through Google AI Studio API keys, see the Google Gemini guide. Vertex needs a GCP project, a region where the model is available, and either Application Default Credentials or a service-account JSON key. GoModel routes to Vertex’s native Gemini publisher endpoint by default; switch to the OpenAI-compatible endpoint when you need its compatibility behavior.
Vertex authentication is enterprise-oriented and may become paid or licensed in a future release.

Configure

Or in config.yaml:

Service-account authentication

Multiple regions or accounts

Use suffixed env vars to register additional Vertex providers:
This registers vertex-us and vertex-eu.

Base URLs and modes

Default bases are derived from project and location:
  • OpenAI-compatible: .../projects/{project}/locations/{location}/endpoints/openapi
  • native Gemini: .../projects/{project}/locations/{location}/publishers/google
Vertex embeddings use Vertex AI native prediction regardless of VERTEX_API_MODE. Vertex does not expose Gemini Files or OpenAI-compatible batch operations.

Image input

ModeOpenAI-style image_url
native (default)inline data: URLs only — remote https://... URLs are rejected
openai_compatibleOpenAI-style remote URLs pass through to Vertex’s OpenAI-compatible endpoint

Not yet integrated

  • Automatic fetching of remote image_url values in native mode.
  • Vertex Files and batch prediction APIs.

References