OpenAI released an agentic framework aptly named Agents. What sets this framework apart from others is that it provides a rich set of core building blocks:
Opikās integration with Agents is just one line of code and allows you to analyse and debug the agent execution flow in our Open-Source platform.
Comet provides a hosted version of the Opik platform, simply create an account and grab your API Key.
You can also run the Opik platform locally, see the installation guide for more information.
First, ensure you have both opik and openai-agents packages installed:
Configure the Opik Python SDK for your deployment type. See the Python SDK Configuration guide for detailed instructions on:
opik configureopik.configure()In order to use OpenAI Agents, you will need to configure your OpenAI API key. You can find or create your API keys in these pages:
You can set them as environment variables:
Or set them programmatically:
To enable logging to Opik, simply add the following two lines of code to your existing OpenAI Agents code:
The Opik integration will automatically track both the token usage and overall cost of each LLM call that is being made. You can also view this information aggregated for the entire agent execution.

You can create agents with custom function tools. The OpikTracingProcessor automatically captures all tool calls as well:
@track decoratorIf you need more visibility into what happens inside your tool functions, you can use the @track decorator to trace specific steps within the tool execution:
When you are running multi-turn conversations with OpenAI Agents using OpenAI Agents trace API, Opik integration automatically use the trace group_id as the Thread ID so you can easily review conversation inside Opik. Here is an example below:
OpenAI Agents is still a relatively new framework and we are working on a couple of improvements:
Pretty Mode functionalityIf there are any additional improvements you would like us to make, feel free to open an issue on our GitHub repository.