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
A provider saved in the dashboard uses the host’s Application Default Credentials, or a service-account file on the host, only for Google’s Vertex AI endpoints: aiplatform.googleapis.com, {location}-aiplatform.googleapis.com, and aiplatform.{location}.rep.googleapis.com, over HTTPS. For any other base URL, such as a proxy or a Private Service Connect endpoint, set the auth type to gcp_service_account and save service-account JSON with the provider. Providers declared in config.yaml or environment variables are not restricted. Vertex embeddings use Vertex AI native prediction regardless of VERTEX_API_MODE. In native mode (the default) the image endpoints are served through the publisher endpoints (Imagen via predict, Gemini image models via generateContent); in openai_compatible mode image generation forwards to the OpenAI-compatible endpoint and image edits are rejected. Vertex does not expose Gemini Files or OpenAI-compatible batch operations. Request translation is shared with the Gemini provider: the reasoning-effort clamps, the penalties that are never forwarded, and thought-signature handling apply to Vertex Gemini models (google/gemini-4-argon, …) in both modes, and native mode also drops the sampling parameters on Gemini 3 and 4. Gemini 4 is served from the global, us and eu locations.

Claude models

Set api_mode: anthropic to serve Claude (Anthropic partner models) from Vertex. Chat and Responses requests are sent as Anthropic Messages to .../publishers/anthropic/models/{model}:rawPredict (:streamRawPredict when streaming), authenticated with the same ADC or service-account credentials. The base URL may be the /endpoints/openapi or /publishers/google URL you already use; GoModel derives the /publishers/anthropic URL from it. Vertex does not list Claude models per project, so list them under models. Use the model ID from the Model Garden card.
An instance in this mode serves Claude chat and Responses, and still serves embeddings through the native Vertex API for any embedding model you list under models; keep a second vertex instance for Gemini chat. Token counting and Anthropic batches are not supported.

Image input

Not yet integrated

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

References

Last modified on November 15, 2026