# Google Gemini and Vertex AI cost tracking

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

```python [Python]
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)
```

```ts [TypeScript]
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

- [Reconciliation](/docs/reconciliation).
- [Google model prices](/providers/google).
