All guides

Connect Gemini and Vertex AI Usage to Cloptima

See model-level analytics and budget controls for your Google AI spend.

7 min read Updated June 2026Connect your AI stack
On this page
  1. 01Call Gemini through the same governed endpoint
  2. 02Attribute every call
  3. 03Govern and report

01

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-3.8-flash",   # 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"},
)

02

Attribute every call

Attach team, app, customer, workflow, and run metadata so Gemini and Vertex spend can be compared directly with your other providers.

03

Govern and report

Set model allowlists, environment limits, and budgets for Gemini usage, and keep attributed records to report spend across teams and apps.

Put This Guide Into Practice

Cloptima automates the strategies described in this guide.

No credit card required
5-minute setup
Free plan