This integration is only for Agent tracing. If you are looking for the OpenAI integration with the AI gateway, please see the OpenAI integration.
Give us a star on GitHub!


Keywords AI agent tracing with OpenAI Agents SDK.
- Agents: LLMs configured with instructions, tools, and guardrails
- Handoffs: Transfer control between specialized agents
- Guardrails: Safety checks for input and output validation
- Tracing: Built-in tracking of agent runs for debugging and optimization
Getting started
Prerequisites
Install the required dependencies:.env file:
.env
If you are on the enterprise platform, please use the enterprise endpoint plus the suffix.
Hello world
helloworld.ts
Full example
Here’s a more comprehensive example with multiple agents:full-example.ts
Advanced features
Metadata support
You can add custom metadata (properties) to your traces for better tracking and debugging:metadata-example.ts
Function Calling
Agents can use tools to perform specific tasks. Here’s an example with a weather tool:function_call.ts
Agent Handoffs
Agents can hand off conversations to other specialized agents based on context:handoff.ts
