---
title: "OpenAI Agents SDK integration"
description: "Give an OpenAI Agents SDK SandboxAgent a Promigence sandbox, so its shell and file tools run there instead of on your machine. Your agent code stays the…"
url: "https://www.promigence.ai/integrations/openai-agents-sdk"
site: "Promigence"
---

# OpenAI Agents SDK integration

Give an OpenAI Agents SDK `SandboxAgent` a Promigence sandbox, so its shell and file tools run there instead of on your machine. Your agent code stays the same; only the client you pass in changes.

The package is `promigence-openai-agents` on PyPI, for Python.

## Install

Install it and set your key.

```bash
pip install promigence-openai-agents
export PROMIGENCE_API_KEY=prom_api_...
export PROMIGENCE_SPEND_CAP=5
```

## Example

From the guide [Run OpenAI Agents SDK agents in a Promigence sandbox](https://www.promigence.ai/docs/guides/openai-agents-sdk), which goes on to the spend cap, cleaning up, and what the package does not support.

```python
import asyncio
from agents import RunConfig, Runner
from agents.sandbox import SandboxAgent, SandboxRunConfig
from promigence_openai_agents import PromigenceSandboxClient, PromigenceSandboxClientOptions

agent = SandboxAgent(name="coder", instructions="Use the shell.")

async def main() -> None:
    result = await Runner.run(
        agent,
        "Write a note to note.txt and read it back.",
        run_config=RunConfig(sandbox=SandboxRunConfig(
            client=PromigenceSandboxClient(),
            options=PromigenceSandboxClientOptions(image="python:3.12-slim", spend_cap=1),
        )),
    )
    print(result.final_output)

asyncio.run(main())
```

## Next

- [Run OpenAI Agents SDK agents in a Promigence sandbox](https://www.promigence.ai/docs/guides/openai-agents-sdk)
- [promigence-openai-agents on PyPI](https://pypi.org/project/promigence-openai-agents/)
- [All integrations](https://www.promigence.ai/integrations)

