Back to GuidesLLM Setup

Connect Gemini and Vertex AI Usage to Cloptima

7 min readUpdated June 2026

Why Vertex context matters

Gemini and Vertex AI spend usually sits close to GCP workloads, projects, and teams. Cloptima connects that model usage to the same cloud ownership context as your GCP and Kubernetes cost.

Call Gemini through the same governed endpoint

Connect your Vertex AI / Gemini credentials once via BYOK. Apps then call the same OpenAI- or Anthropic-compatible endpoint and just set the model — the gateway routes by model and policy, so no provider keys live in app code.

python
from openai import OpenAI

client = OpenAI(base_url="https://api.cloptima.ai/v1/ai", api_key="clop_vk_dPXO67p…")

resp = client.chat.completions.create(
    model="gemini-1.5-pro",   # approved Gemini/Vertex model (Cloptima maps to the provider id)
    messages=[{"role": "user", "content": "..."}],
    extra_headers={"x-cloptima-team": "data", "x-cloptima-app": "insights", "x-cloptima-environment": "production"},
)

Attribute alongside GCP cost

Attach team, app, customer, workflow, and run metadata so Gemini and Vertex spend can be compared directly with GCP and Kubernetes cost centers.

Govern and reconcile

Set model allowlists, environment limits, and budgets for Gemini usage, and keep reconciliation-ready records to compare against Vertex billing exports as workflows mature.

Put This Guide Into Practice

Cloptima automates the strategies described in this guide.

No credit card required
5-minute setup
Free trial