Skip to main content
For a complete example, see the OpenAI Agents example on GitHub.
Gentrace integrates with OpenAI Agents SDK using OpenInference instrumentation to automatically trace agent conversations, tool calls, and agent handoffs.

Prerequisites

Installation

Configuration

Initialize Gentrace with OpenAI Agents instrumentation:
openai_agents_instrumentation.py

Environment Variables

.env

What Gets Traced

The OpenAI Agents instrumentation automatically captures:
  • Agent conversations - All messages between users and agents
  • Tool calls - Function invocations with parameters and results
  • Agent handoffs - Transfers between specialized agents
  • Context variables - Shared state between agents
  • Full message history - Complete conversation flow

Advanced Features

Multiple Agents

Context Variables