Skip to main content
Gemini API Managed Agents run the agent loop for you, in a Google-hosted environment or one you host yourself. No OpenTelemetry export is documented for them. Instead, each Interaction resource carries the steps and the token usage. EvalGate reads saved interactions offline into the same evalgate.agent-run.v2 runs as Claude Code, so a view or report can compare them.
This decoder is Experimental. It is written from Google’s Interactions API reference and tested against a synthetic capture, not a real one. The API is in preview and its fields can change. It ships in the TypeScript 4.0.0 source candidate of @evalgate/sdk, which is not published yet. EvalGate never calls the Gemini API and never holds a Gemini key: you save the interactions yourself.

1. Save the interactions

Fetch each interaction of the task with interactions.get and write its JSON on one line of a file, for example with jq -c .. Include every interaction in the previous_interaction_id chain. The resources contain prompts, thoughts, outputs, tool arguments and tool results; treat the file as sensitive and delete it after the import.

2. Import the interactions

Each previous_interaction_id chain becomes one run, whatever order the lines are in; --run-id folds every chain into one run. Use --runtime-host google_agent_platform for the Managed Agents API on Agent Platform. When you give a runtime host, the hosting comes from the interaction’s environment (remote or mode: self_hosted) unless you pass --runtime-hosting, and the environment id is kept only as a salted digest. EvalGate never infers the host or the sandbox provider.

What the run contains

An unfinished interaction’s usage is not counted, and any interaction without a count makes that run total n/a with reason not_exported instead of an undercount. One interaction can hold several model calls, so API requests and retries stay not_exported, as do cache writes, cost (the offline price snapshot covers Anthropic models only), file reads and edits, subagent measures and time waiting on a person. Text, thoughts, signatures, tool arguments and results, error messages, system instructions and labels are never read into the run. Interaction ids are replaced by salted digests. Every number is self-reported by the Gemini API and is not verified against billing data. To compare runs, continue with cost of quality for coding agents.