> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI Agents JS Integration

> OpenAI Agents JS Integration v0.1.6

<Warning>
  `@braintrust/openai-agents` is deprecated. This is the final release. Trace OpenAI Agents SDK runs with the `braintrust` package instead.
</Warning>

## Migration

Install `braintrust`, then prefer auto-instrumentation: run your app with Braintrust's import hook (`node --import braintrust/hook.mjs`) to trace OpenAI Agents SDK runs without changing your code. If you need direct control over trace processor registration, import `OpenAIAgentsTraceProcessor` from `braintrust/instrumentation` and register it manually. See the [OpenAI Agents SDK](/docs/integrations/agent-frameworks/openai-agents-sdk) integration guide for setup examples.

## Installation

<CodeGroup>
  ```bash npm theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  npm install @braintrust/openai-agents
  ```

  ```bash pnpm theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  pnpm add @braintrust/openai-agents
  ```
</CodeGroup>

## API Reference

### Classes

#### OpenAIAgentsTraceProcessor

`OpenAIAgentsTraceProcessor` is a tracing processor that logs traces from the OpenAI Agents SDK to Braintrust. Args: options: Configuration options including: - logger: A `Span`, `Experiment`, or `Logger` to use for logging. If `undefined`, the current span, experiment, or logger will be selected exactly as in `startSpan`. - maxTraces: Maximum number of concurrent traces to keep in memory (default: 1000). When exceeded, oldest traces are evicted using LRU policy.

## Source Code

For the complete source code and additional examples, visit the [Braintrust JavaScript SDK repository](https://github.com/braintrustdata/braintrust-sdk-javascript/tree/main/integrations/openai-agents-js).
