Google Gemini and Vertex AI cost tracking
Price every Gemini call through the Gemini API or Vertex AI, and reconcile it to your Google Cloud billing export in BigQuery.
By Keyveve, Inc. · Updated 2026-10-23
Wrap the Google GenAI client, for the Gemini API or Vertex AI, and every call is priced at Google's list rates, with cached input and thinking tokens counted.
Wrap the client
import veqen
from google import genai
veqen.init() # reads VEQEN_API_KEY, an ingest key
client = veqen.wrap(genai.Client(vertexai=True, project="acme-prod", location="global"), feature="summaries")
with veqen.tags(customer=org.id):
client.models.generate_content(model="gemini-2.5-flash", contents=text)
import { GoogleGenAI } from "@google/genai";
import { wrap, withTags } from "@veqen/sdk";
const client = wrap(new GoogleGenAI({ vertexai: true, project: "acme-prod", location: "global" }), { feature: "summaries" });
await withTags({ customer: org.id }, () => client.models.generateContent({ model: "gemini-2.5-flash", contents: text }));
For the Gemini API, create the client with an API key instead; the pricing is the same. Claude on Vertex: wrap AnthropicVertex from the Anthropic SDK.
Reconcile to the bill
Turn on the Cloud Billing export to BigQuery, then add a Google Cloud connection under Settings › Connections with the export table and a service account key that can read it. Veqen imports Vertex AI and Gemini API cost per model each day. Give it a label key (for example team) to split the bill by that label.
Next
Veqen records what every AI request cost and who it was for, checks it against your provider bills and prepares the entries for your accounting system. Start free or read the quickstart.