Skip to main content
This is a different package from plain openai: the Agents SDK (import agents) adds its own Agent/Runner abstraction, tool calling, and handoffs on top of the Chat Completions/Responses APIs. Use this page if your code imports from agents; use the OpenAI page if you’re calling openai.chat.completions.create() directly. Install:

Usage

subject.framework is an open string - any label is accepted. The values listed on EvaluationSubject Fields are the conventions the dashboard groups by, and the tracing integrations stamp "openai-agents" too, so using it here keeps eval runs and traces under the same label.

With tracing

Unlike Anthropic/LangChain/CrewAI, there’s no way to get trace_id back from the Agents SDK’s own tracing integration (AgentXTracingProcessor). It’s a processor you register once at startup and it reports on its own schedule as runs complete elsewhere in the SDK, not a span your eval function controls. To link a trace to an eval result, wrap Runner.run_sync(...) in tracer.trace(..., sync=True) directly instead, the same pattern as the raw OpenAI example. Inside .execute(), traces are automatically stamped monitor=False (and source="eval-run"), so no flag is needed:
If you also want every other (non-eval) run of this agent traced automatically, not just the ones going through an evaluation, register AgentXTracingProcessor globally in addition to the pattern above. The two don’t conflict, but they are independent: the processor’s traces are separate from, and won’t be linked to, any eval result’s trace_id.

EvaluationCase fields

Same contract as every other framework: see Examples overview for the full EvaluationCase/return-value reference. case.query is what you pass to Runner.run_sync(agent, case.query).