Integrations/Google Gemini
LLM Provider

Google Gemini Monitoring & API Tracing

Auto-instrument every Gemini generate_content call, streaming and non-streaming, with zero code changes. Get token-level traces, cost at Google's published rates, and cached token visibility in your dashboard.

Free tier · No credit card · 2-minute setup

What you get with Fluiq for Google Gemini

Streaming + batch traces

Both streaming and non-streaming generate_content calls are traced, with per-token counts, model version, latency, and finish reason captured on every request.

Cached token tracking

Gemini cached token usage is tracked per call and surfaced in the Optimize dashboard, see exactly how much you're saving on context caching.

Cost at Gemini rates

Token costs calculated at Google's published Gemini rates for each model tier, attributed per trace and visible in aggregate cost analytics.

Setup

Add Fluiq to your Google Gemini app in 2 lines

import fluiq
fluiq.instrument(api_key="fl_...")  # patches google-generativeai automatically

import google.generativeai as genai
genai.configure(api_key="your-gemini-key")
model = genai.GenerativeModel("gemini-1.5-pro")

# Traced automatically, sync and async:
response = model.generate_content("Explain LLM observability in one paragraph")

# Streaming is also traced:
for chunk in model.generate_content("Write a haiku", stream=True):
    print(chunk.text, end="")

What Fluiq instruments in Google Gemini

Every call to these methods is automatically traced, no decorators, no wrappers, no manual spans.

genai.GenerativeModel.generate_content()
genai.GenerativeModel.generate_content_async()
genai.GenerativeModel.stream_generate_content()
genai.embed_content()
genai.embed_content_async()
genai.GenerativeModel.count_tokens()

Start tracing Google Gemini in 2 minutes

Free tier. No credit card. Full traces, security scanning, and evals on your first Google Gemini call.

50,000 free traces / month · 1,000 evals / month · 14-day retention