Connect Gemini API and Vertex AI
Connect Gemini API or Vertex AI to see what your Google Cloud billing account spends on them, beside the rest of your AI spend. Both are billed through Google Cloud, so both read your Cloud Billing export in BigQuery. You don’t share a service account key.
You need access to connect AI providers. Ask your Flowstate admin. You also need someone who can manage billing and IAM in Google Cloud.
Choose the connection
| Open this in Flowstate | Covers |
|---|---|
| Gemini API (AI Studio) | Gemini API spend |
| Vertex AI (GCP) | Vertex AI spend |
Connect either or both. The set-up is the same, so the second one is quick.
Before you start
- Billing Account Costs Manager or Billing Account Administrator on the billing account.
- BigQuery User on the project that holds the export dataset.
- The billing export switched on in Billing → Billing export, pointed at a US or EU multi-region dataset.
- Access for Flowstate set up by your technical team. See For your technical team.
Connect
- Go to Settings → Integrations, select Browse catalog and open Gemini API (AI Studio) or Vertex AI (GCP).
- Under How to connect, select Use this route.
- Enter the GCP project number, Workload Identity Pool id and Pool provider id.
- Enter the Reader service account email.
- Enter the Billing export table, in the form
project.dataset.table. - Optional, for Vertex AI (GCP): to see spend by team, product or anything else you label, enter a label key, such as
team, in Split spend by label (optional). - Select Verify and connect.
Check it’s working
The connection is listed under Connected keys with the status Working. See the spend in Agent insights.
What Flowstate brings in
- Billed cost by product and Google Cloud project, each day, in your billing account’s currency, before any credits.
- For Vertex AI, if you chose a label, each day’s spend split by that label’s value. Unlabelled spend stays as one line.
- A total for your billing account. Google doesn’t report cost per person.
- Flowstate syncs every hour, and brings in whatever history your export holds when you first connect.
If something’s not right
Older spend is missing. The export only holds spend from when it was switched on, or from the start of the previous month for a multi-region dataset.
The connection fails. The pool, the service account’s permissions or the table name is wrong. Select Show what the provider said to see Google’s error.
For your technical team
- Ask your Flowstate contact for the issuer and subject for your organisation.
- In Google Cloud, go to IAM → Workload Identity Pools. Create a pool and an OpenID Connect provider that trusts that issuer and subject.
- Create a service account for Flowstate to read with. Give it BigQuery Data Viewer on the export dataset and BigQuery Job User on the project.
- Let the pool use that service account.