Skip to main content
Automatically capture all Gemini model calls made through the google-genai SDK.

Setup

Usage

Once initialized, all Gemini calls are captured automatically — including tool-call requests:
If you pass Python functions as tools, the SDK’s automatic function calling runs the whole tool loop inside one generate_content call. That records one span, priced on the last model call only. For accurate cost, pass function declarations instead (as above) or set automatic_function_calling=types.AutomaticFunctionCallingConfig(disable=True), and run the tool loop yourself as the example does.

What Gets Captured

Run the example

Clone the repo and run a complete agent end-to-end.

Python

Run the Python example