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

# OpenAI Agents SDK

> Auto-instrument OpenAI Agents with Cascade

Cascade provides auto-instrumentation for the OpenAI Agents SDK. A single function call translates the framework's native events into Cascade spans with no changes to your existing agent code.

## Setup

```python theme={null}
from cascade import init_tracing
from cascade.integrations import instrument_openai_agents

init_tracing(project="my_openai_agent")
instrument_openai_agents()

# Existing OpenAI Agents code - no changes needed
from agents import Agent, Runner

agent = Agent(name="MyAgent", ...)
result = Runner.run_sync(agent, "Hello")
```

<Note>
  Requires the `openai-agents` package:

  ```bash theme={null}
  pip install openai-agents
  ```
</Note>

## What gets traced automatically

The integration automatically captures:

* **Agent spans**: with agent names
* **LLM generation spans**: with model, prompt, completion, and token usage
* **Function/tool calls**: with input and output values
* **Guardrail checks**: safety and validation guardrails
* **Agent handoffs**: with from/to agent info
