Overview
Client-mode REST API connectors for Google Gemini: triage alarms and summarize shift logs with generateContent (structured JSON output), create embeddings, count tokens and list models with a Gemini API key, run Gemini and custom anomaly models on Vertex AI (predict on your endpoint), and get Google OAuth 2.0 access tokens. This is one of the templates in the Google Gemini API and Vertex AI REST API app (google-gemini-api-and-vertex-ai). Deploy it alongside the other connectors of that app when they depend on each other (for example a token connector plus an API connector).
Auth
Gemini API: header x-goog-api-key {value.json.api_key} (Google AI Studio / Cloud API key; Hub secret GEMINI_API_KEY via GET SECRET). Vertex AI: Authorization: Bearer {value.json.access_token}, OAuth 2.0 access token with scope https://www.googleapis.com/auth/cloud-platform for an identity with roles/aiplatform.user (~1 h lifetime); GoogleOAuthToken connector gets it (refresh_token grant with client id/secret/refresh token, or service-account JWT bearer grant with a JWT signed outside the broker). Hub secrets GEMINI_API_KEY, GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET, GOOGLE_OAUTH_REFRESH_TOKEN. Never commit keys, tokens or service-account JSON. Auth headers used by the template:Authorization: Bearer {value.json.access_token}.
Template parameters
BASE_ADDRESS default: https://YOUR_REGION-aiplatform.googleapis.com.
Events
Deploy
Get the template card (JSON withtemplate and metadata) from the broker, then deploy the connector:
BASE_ADDRESS already filled in:
-addConnector (do not include ADD METADATA).
Usage example
CallVertexGenerateContent by publishing a JSON payload to its request topic, and read the reply on the response topic:

