GET /v1/agents/sessions/{session_id}/traces. EvalGate
reads the saved pages offline into the same evalgate.agent-run.v2 runs as
Claude Code, so a view or report can compare them.
1. Export a session’s traces
Trace export must be enabled for your organization, and the key needsapi.traces.read (or api.agents.read) on the session’s project. Keep the
key in your shell; EvalGate never reads it.
Save each page as one line. Follow has_more and last_id until the last
page:
2. Import the pages
--run-id folds every trace in the file into one run. Without it, EvalGate
groups spans by gen_ai.conversation.id when present, else by trace id. Use
--runtime-hosting self_hosted and --sandbox-provider <id> when the session
ran in your own environment; EvalGate never infers either from the traces.
What the run contains
OpenAI reports usage best-effort: a
null count means unknown, not zero.
If any request in the run lacks a count, that run total stays n/a with
reason not_exported instead of an undercount. Cost stays n/a because the
offline price snapshot covers Anthropic models only. File reads and edits,
subagent tokens and depth, time waiting on a person, prompts and refusals
also stay not_exported.
Messages, system instructions, agent names and descriptions, tool arguments
and results, user.id and URLs are dropped while decoding. Every number is
self-reported by OpenAI’s export and is not verified against billing data. To
compare runs, continue with
cost of quality for coding agents.