Gemini & Vertex AI

Gemini & Vertex AI

Google models connect through translating adapters: your applications keep speaking the OpenAI shape (or Anthropic Messages), and the gateway maps requests to Gemini's generateContent — with API-key auth for Gemini, or GCP service-account auth for Vertex AI, including Claude on Vertex.

Gemini (API key)

Command
curl -s -u admin:PASSWORD -X POST https://aam.example.com/admin/providers \
  -H "Content-Type: application/json" \
  -d '{
    "name": "gemini",
    "baseUrl": "https://generativelanguage.googleapis.com/v1beta",
    "apiKey": "YOUR-GEMINI-API-KEY",
    "protocol": "gemini"
  }'

curl -s -u admin:PASSWORD -X POST https://aam.example.com/admin/deployments \
  -H "Content-Type: application/json" \
  -d '{"alias": "gemini-flash", "providerName": "gemini", "upstreamModel": "gemini-2.0-flash"}'

The adapter authenticates with x-goog-api-key and puts the model in the URL path. Streaming is real (streamGenerateContent translated into OpenAI chunks), and the mapping carries the system instruction, conversation text, sampling parameters, tool/function calling, and multimodal input — a data: image URI or audio part becomes inline data; an http(s) image URL becomes a file reference, which Gemini resolves only for Files-API or GCS URIs.

Gemini on Vertex AI (service account)

Use protocol: vertex with a regional base URL, and a GCP service-account JSON as the credential — the gateway mints, caches, and refreshes a scoped access token from it (a ready-to-use bearer token also works):

Command
curl -s -u admin:PASSWORD -X POST https://aam.example.com/admin/providers \
  -H "Content-Type: application/json" \
  -d '{
    "name": "vertex",
    "baseUrl": "https://us-central1-aiplatform.googleapis.com/v1/projects/PROJECT/locations/us-central1/publishers/google/models",
    "apiKey": "{ ...service-account JSON... }",
    "protocol": "vertex"
  }'

The service-account JSON is stored AES-256-GCM encrypted like any other provider credential.

Claude on Vertex AI

protocol: vertex-anthropic serves Anthropic models hosted on Vertex, reusing the Anthropic translation and streaming against Vertex's rawPredict/streamRawPredict — same service-account auth as above, with the Anthropic version header injected for you. Your OpenAI-shaped or Messages-shaped clients need no changes.

Translation limits to know

Translating adapters carry the mapped feature set (system, conversation, sampling params, tools, the multimodal inputs above); parameters outside it are dropped or mapped best-effort. If a workload leans on a vendor-specific feature, route it to a same-protocol deployment where passthrough applies — see the passthrough promise.