The Respan Google GenAI integration enables full observability for Gemini models through Google's official SDK. Route requests through the Respan gateway for automatic logging, monitoring, and analytics.
The integration supports all GenAI features including temperature and sampling controls, safety settings, system instructions, structured output via response schemas, and thinking configuration for reasoning models.
Install the Google GenAI SDK and initialize the client with your Respan API key and the Respan base URL (https://api.keywordsai.co/api/google/gemini).
Use the standard GenAI SDK methods - generate_content, streaming, and tool calls. Every request is logged automatically with token usage, cost, and latency metrics.
python
from google import genai
client = genai.Client(
api_key="YOUR_RESPAN_API_KEY",
http_options={"api_version": "v1beta", "base_url": "https://api.keywordsai.co/api/google/gemini"},
)
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Explain how transformers work",
)