Skip to main content
OpenAI Agents SDK is a lightweight framework for building multi-agent workflows. It provides agents, handoffs, tools, guardrails, and session management out of the box. HoneyHive integrates with the Agents SDK via the OpenAIAgentsInstrumentor, automatically capturing agent runs, tool calls, handoffs, and LLM interactions.

Quick Start

Add HoneyHive tracing in just 3 lines of code. Initialize the tracer and instrumentor, and all agent runs, tool calls, handoffs, and model calls are automatically traced.
To see where to initialize the tracer for your environment, including AWS Lambda and long-running servers, see Tracer Initialization.
Last tested with openai-agents 0.14.6 (April 2026).

What Gets Traced

This setup captures:
  • Agent runs - Every agent invocation with inputs and outputs
  • LLM calls - Model requests, responses, and token usage
  • Tool calls - Each tool execution with arguments and results
  • Handoffs - Agent-to-agent delegation with routing context
  • Agents-as-tools - Nested agent delegation via agent.as_tool()
No manual @trace decorators are required for the standard Agents SDK path.
The openai-agents pip package exposes agents as its top-level module, so imports use from agents import ....All examples below assume the Quick Start setup above. The setup block is repeated in each snippet so they are individually copy-pasteable.

Example: Single Agent with Tools


Example: Multi-Agent Handoffs

The Agents SDK supports handoffs where a triage agent delegates to specialists:
In HoneyHive, you’ll see the full trace hierarchy: triage agent routing to the specialist, which then calls the tool and responds.

Example: Agents-as-Tools

For parallel execution, wrap specialist agents as tools using agent.as_tool():
In HoneyHive, you’ll see the coordinator agent calling specialist sub-agents as tools, with nested LLM and tool spans.

Troubleshooting

Traces not appearing

  1. Check environment variables - Ensure HH_API_KEY is set
  2. Pass the tracer provider - The instrumentor must receive tracer_provider=tracer.provider:
  1. Call force_flush() before exit - Ensure traces are exported before the process ends:
  1. Check your model provider - Ensure OPENAI_API_KEY is set

Enrich Your Traces

Add user IDs and custom metadata to agent traces

Custom Spans

Create spans for business logic around agent calls

Distributed Tracing

Trace agents across service boundaries

Resources