Skip to content

OpenAI Agents SDK

Trace OpenAI Agents SDK runs by wiring AxonPushRunHooks into your agent configuration. Captures agent lifecycle, tool calls, and handoffs between agents.

Terminal window
npm install @axonpush/sdk openai
import { AxonPush } from "@axonpush/sdk";
import { AxonPushRunHooks } from "@axonpush/sdk/integrations/openai-agents";
const client = new AxonPush({
apiKey: process.env.AXONPUSH_API_KEY!,
tenantId: process.env.AXONPUSH_TENANT_ID!,
});
const hooks = new AxonPushRunHooks({
client,
channelId: 1,
agentId: "my-agent",
});
import { Agent, Runner } from "openai/agents";
const agent = new Agent({
name: "assistant",
instructions: "You are a helpful assistant.",
tools: [webSearch, calculator],
});
const result = await Runner.run(agent, input, { hooks });
EventWhen
agent.run.startAn agent run begins
agent.run.endAn agent run completes
tool.*.startA tool invocation begins
tool.*.endA tool invocation completes
agent.handoffControl is handed off to another agent