Use Gemini’s Python SDK to integrate with Helicone to log your Gemini AI usage.
Create Google Generative AI API Key
Set API keys as environment variables
Install the Google Generative AI SDK
Import and configure the client
GOOGLE_GENAI_USE_VERTEXAI=True
), you need to modify the target URL to point to the Vertex AI endpoint:GOOGLE_CLOUD_LOCATION
environment variable is set to your Google Cloud region (e.g., us-central1
).Generate content using the model