← Blog

How to Track Google Gemini Costs by Customer (Vertex AI and AI Studio)

We moved our summarisation feature to Gemini 2.0 Flash. Cheaper than GPT-4o mini for long inputs. Great. Two months later, our Google bill was $2,400/month and climbing. We had no breakdown by customer. AI Studio showed total usage. Vertex showed total usage. Neither showed who was using it. If you're on Vertex AI or AI Studio and need to track Gemini costs by customer, you've hit the same wall.

The Gemini API supports metadata — user IDs, custom labels. We added it to the new feature. Forgot to add it to the legacy email drafting flow that also called Gemini. And the internal tool our support team used. Three different code paths, two untagged. Our "cost per customer" view was missing 40% of our Google spend. Vertex AI cost attribution only works when every call path passes the right metadata. Ours didn't.

Why Google AI cost per customer is harder than it looks

AI Studio and Vertex AI have different billing. Different export formats. Different ways to get usage data. If you use both — we did — you have two dashboards, neither showing cost per user. The Gemini API cost per user is the same problem as OpenAI and Anthropic: the provider shows totals, not attribution. You need to build that layer yourself. Or connect to something that does it for you.

Three pipelines? No thanks

We looked at building a logging layer for Gemini. That would make three pipelines: OpenAI, Anthropic, Google. Different APIs, different billing cycles, different export formats. Our one data engineer was already drowning in the first two. Adding a third wasn't an option. We needed a unified view.

What we needed was something that connected to all three and gave us one view. Cost per customer across every provider. Cost per feature. Cost by tier. No pipelines, no data warehouse. Just the breakdown we needed to make pricing decisions. A Google AI customer spending breakdown that actually showed who was driving the bill.

What we found when we had the full picture

One customer was doing bulk document analysis through our API — 80,000 requests per month, almost all Gemini. We were charging them $299. Their AI cost alone was $340. We'd never have seen that from the Google dashboards. We raised their price. They stayed. Another was using Gemini for a feature we thought was low-volume. It wasn't. We gated it. Our Gemini API cost per user visibility gave us the data we needed to fix pricing before we scaled further.

PerUnit connects to Google (AI Studio and Vertex), OpenAI, and Anthropic — plus Stripe. Cost attribution without data engineering. For a quick estimate of Gemini costs, try our model comparison tool.

Need cost per customer, not just totals?

PerUnit breaks down your AI spend by customer, feature, and pricing tier — so you know who to charge more, what to gate, and where to cut.

Get early access to PerUnit →