Documentation / Integrations / Google Gemini (API)

Google Gemini (API) connector

Connect Google Gemini (AI Studio). An API key alone validates the connection. Spend sync requires paid-tier usage and BigQuery billing export on the GCP project that owns the key.

AvailableMethod: API

Overview

Connect Google Gemini (AI Studio). An API key alone validates the connection. Spend sync requires paid-tier usage and BigQuery billing export on the GCP project that owns the key.

Data pulled

  • With export credentials: net spend from BigQuery billing export for Gemini / Generative Language services (observed service.description values from your export)
  • API key alone: no spend is retrieved — status remains validation only
  • Free-tier AI Studio usage has no spend to meter

What gets attributed

When billing export credentials are added, Meridian reads the BigQuery billing export, filtered to the Gemini or Generative Language service names found in your export, and stores one row per day per model name derived from the SKU. It does not read project ids, labels or API key identity, so rows carry no team or agent information. With only an API key, no spend is stored.

Gemini rows arrive unattributed in the attribution inbox (Agents & allocation → Unattributed), where you can assign them or create a rule that matches on vendor or model.

Authentication & credential storage

Meridian stores the following fields for this connector (values encrypted at rest):

  • api_key (required)
  • service_account_json, project_id, dataset_id, billing_account_id (optional — required for spend)
  • Credentials are encrypted with AES-256-GCM using a KMS-wrapped data encryption key (DEK) and stored in vendor_connections.credentials_encrypted.
  • Meridian never returns the plaintext key after save. Revocation is disconnect: deactivate or delete the vendor connection — sync stops and the encrypted blob is no longer used.
  • Paid tier required for billable Gemini API usage. Enable Cloud Billing export to BigQuery. Service account needs BigQuery read (jobUser + dataViewer).
  • Disconnect removes the encrypted credential blob from active sync.

Sync schedule & behavior

When export is configured, billing-export lag is typically 1–6 hours. Syncs automatically every 6 hours; manual sync anytime. There is no per-connection frequency setting.

Setup steps

  1. Create an AI Studio API key and connect Google Gemini in Meridian (validates via the models list).
  2. For spend: enable billing export on the paid GCP project, create a BigQuery-capable service account, and add those fields to the connection.
  3. If you only add the API key, expect validation only — no spend source configured. Free-tier usage will never produce spend rows.

Troubleshooting

  • Validation only status: add export credentials or accept key-only mode.
  • No matching billing rows: confirm paid usage and export lag; run the discovery script against your export table to record service.description values.
  • Do not expect a billing API behind the AI Studio key — it does not exist.

Related

Onaro Meridian is FinOps for agentic AI: the system of record that attributes, controls and books what AI agents spend.