The OpenAI Agents SDK enables you to build agentic AI apps in a lightweight, easy-to-use package with very few abstractions. It’s a production-ready upgrade of our previous experimentation for agents, Swarm. The Agents SDK has a very small set of primitives:

  • Agents, which are LLMs equipped with instructions and tools
  • Handoffs, which allow agents to delegate to other agents for specific tasks
  • Guardrails, which enable the inputs to agents to be validated

Integrating with Maxim

1

Create account

Create a Maxim account and a Log repository. Follow the instructions in the quickstart section.

2

Install SDK

Install Maxim SDK

pip install maxim-py
3

Set the following environment variables to configure the Maxim SDK

Environment VariableDescription
MAXIM_API_KEYYour Maxim API key
MAXIM_LOG_REPO_IDID of the log repository to use

And then Maxim SDK will automatically initialize using these env variables.

from maxim import Maxim,Config
from maxim.logger.openai.agents import MaximOpenAIAgentsTracingProcessor
# Creating a new logger instance
# It automatically initializes using MAXIM_API_KEY and MAXIM_LOG_REPO_ID from env variables.
logger = Maxim(Config()).logger()
4

Manually initialize OR you can manually initialize the SDK

from maxim import Maxim,Config
from maxim.logger import LoggerConfig

logger = Maxim(Config(api_key="your_api_key")).logger(LoggerConfig(id="your_log_repo_id"))
5

Add tracing processor

Add the MaximOpenAIAgentsTracingProcessor to your agent using add_trace_processor or set_trace_processor.

from agents import add_trace_processor
from maxim.logger.openai.agents import MaximOpenAIAgentsTracingProcessor

add_trace_processor(MaximOpenAIAgentsTracingProcessor(logger))

# Your agent code

Cookbooks

Here are a few cookbooks that you can use to get started with Maxim:

  1. Language Agent
  2. Customer support agent