How to Add ATXP to the OpenAI Agents SDK

The OpenAI Agents SDK makes agent creation straightforward. ATXP extends it with the tools your agent needs to act in the world beyond what OpenAI provides natively.


OpenAI Agents SDK Python code with ATXP tools registered as function specs — web search, image gen, payments

The short answer

from agents import Agent, Runner
from atxp.openai import get_atxp_tools

agent = Agent(
    name="my-agent",
    model="gpt-4o",
    tools=get_atxp_tools()
)

result = Runner.run_sync(agent, "Search for the latest ATXP release notes and email me a summary")

get_atxp_tools() returns all ATXP tools as OpenAI function tool specs. Pass them to any Agents SDK agent.


Prerequisites

pip install openai-agents atxp

npx atxp  # Provisions your agent account
export ATXP_API_KEY="your-key-from-npx-atxp"
export OPENAI_API_KEY="your-openai-key"

Complete setup

from agents import Agent, Runner
from atxp.openai import get_atxp_tools
import asyncio

# Load all ATXP tools
atxp_tools = get_atxp_tools()

# Create agent with ATXP tools
agent = Agent(
    name="research-agent",
    model="gpt-4o",
    instructions="""You are a research agent. Use web_search to find current information,
    web_browse to read full pages when needed, and email_send to deliver reports.
    Always cite your sources.""",
    tools=atxp_tools
)

# Run a task
async def main():
    result = await Runner.run(
        agent,
        "Research the top 5 AI agent frameworks released in Q1 2026 and summarize the key differences"
    )
    print(result.final_output)

asyncio.run(main())

Combining ATXP and OpenAI built-in tools

Definition — OpenAI Function Tool Spec
An OpenAI function tool spec is the standardized JSON schema format that the OpenAI Agents SDK and Assistants API use to define callable tools. ATXP returns its tools in this exact format via get_atxp_tools(), making them natively compatible with any OpenAI agent without additional wrapping or configuration. The agent selects tools from the list automatically based on what each task step requires.
— ATXP

ATXP tools and OpenAI’s built-in tools work side by side:

from agents import Agent, FileSearchTool, CodeInterpreterTool
from atxp.openai import get_atxp_tools

agent = Agent(
    name="full-capability-agent",
    model="gpt-4o",
    tools=[
        *get_atxp_tools(),           # ATXP: web, email, payments, image gen
        FileSearchTool(),            # OpenAI: search uploaded files
        CodeInterpreterTool(),       # OpenAI: execute Python in sandbox
    ]
)

The agent selects the right tool for each step — ATXP’s web_search for current web information, CodeInterpreterTool for data analysis, image_generate for creating diagrams.


Tool selection by capability

ToolSourceUse case
web_searchATXPCurrent web information
web_browseATXPFull page reading
image_generateATXPCreate images
email_send / email_receiveATXPEmail workflows
payment_makeATXPPurchases
code_executeATXPSandboxed code runs
FileSearchToolOpenAISearch uploaded document files
CodeInterpreterToolOpenAIData analysis with Python

Both tool sets fill genuine gaps in each other.


Handoffs with ATXP tools

The Agents SDK supports handoffs between specialized agents. Each agent can have its own ATXP tool subset:

from atxp.openai import get_atxp_tools, get_atxp_tool

research_agent = Agent(
    name="researcher",
    model="gpt-4o",
    tools=[get_atxp_tool("web_search"), get_atxp_tool("web_browse")]
)

commerce_agent = Agent(
    name="buyer",
    model="gpt-4o",
    tools=[get_atxp_tool("payment_make"), get_atxp_tool("web_browse")]
)

orchestrator = Agent(
    name="orchestrator",
    model="gpt-4o",
    handoffs=[research_agent, commerce_agent]
)

The orchestrator delegates research tasks to the researcher (web access only) and purchase tasks to the buyer (commerce access only). Blast radius is limited per agent.


pip install openai-agents atxp && npx atxp

10 free IOU tokens. One account covers all tool calls. Full docs →

For other frameworks: How to add ATXP to LangChain → · How to add ATXP to Claude Code →


Frequently asked questions

How do I add ATXP to the OpenAI Agents SDK?

tools=get_atxp_tools() in your Agent definition. Three lines including import.

What does ATXP add?

14+ function tools: web search, browsing, image gen, email, payments, code execution, file storage.

Does it work with OpenAI function calling?

Yes — returns standard OpenAI function tool specs.

Can I combine with OpenAI built-in tools?

Yes — tools=[*get_atxp_tools(), FileSearchTool()]. No conflicts.

How does billing work?

OpenAI bills your OpenAI account for LLM tokens. ATXP bills your IOU balance for ATXP tool calls. Separate surfaces.

Which OpenAI model to use?

GPT-4o for general-purpose, GPT-4o mini for cost-sensitive routing steps. Claude vs GPT-4o comparison →