Connect OpenAI Agents SDK to Anoman AI
Swap the base URL on AsyncOpenAI to add guardrails, batch routing, and observability to every agent run. No changes to your agent or tool definitions required.
Prerequisites
- An Anoman AI account with an active API key
- Python 3.9+
- OpenAI Agents SDK installed
Step 1: Install dependencies
Step 2: Configure the client with Anoman
Pass a custom AsyncOpenAI client with Anoman's base URL to set_default_openai_client. All agents created after this call use Anoman automatically.
Step 3: Define and run agents
Your agent and tool definitions stay exactly as they are. Every LLM call in a run passes through Anoman's guardrail pipeline.
Agents with tools
Tool definitions are unchanged. Anoman's MCP governance layer can apply per-tool allow/deny policies if an MCP policy is attached to your API key.
When a guardrail triggers
If the guardrail pipeline blocks a request, Anoman returns a 403. The SDK raises an openai.APIStatusError which surfaces in Runner.run.
Check docs/openapi/ for the current error schema.
Guardrail transparency headers
Every response includes guardrail result headers. Check these in your API logs to verify the pipeline is running on each agent step.
Need help with your integration?
Join the Founding 50 for early access and direct support from the Anoman team.