Back

OpenAI Python Agent Framework on Agentuity

June 17, 2025 by Joel Samuel

OpenAI

OpenAI has a new agent framework for building Multi-Agent Systems. The problem is they don't really tell you how to deploy them. And trying to deploy them on existing cloud providers is a bit of a pain. What if you could deploy your existing OpenAI agents, with just one command? That's where Agentuity comes in.

The OpenAI Agents

Check out the example repo

In Agentuity, there's only a few deployment conventions you need to follow to deploy any agent. A yaml file, and an agents folder with a handler that all the requests to your agent go through.

from agentuity import AgentRequest, AgentResponse, AgentContext
from agents import Agent, Runner

# Define your OpenAI agents
math_tutor = Agent(
    name="Math Tutor",
    instructions="You help students with math problems step by step."
)

# Agentuity handler - wraps your OpenAI Agent workflow
async def run(request: AgentRequest, response: AgentResponse, context: AgentContext):
    # Get user input from Agentuity
    user_question = await request.data.text()
    
    # Run your OpenAI Agent
    result = await Runner.run(math_tutor, user_question)
    
    # Return response through Agentuity
    return response.text(str(result.final_output))

Integrating with Agentuity

Notice how little code is needed to make OpenAI agents work within Agentuity? The core logic remains the same. We just need to:

  1. Wrap the agent invocation within an AgentHandler function.
  2. Read the user's input from req.data.text().
  3. Return the output using methods like resp.text().

Deploying to the Cloud

Once your agent is set up, deploying is trivial. Assuming you have the Agentuity CLI installed and configured, navigate to your project directory and run agentuity deploy.

That's it! Your OpenAI agent is now live and accessible via an API endpoint provided by Agentuity.

Again, Check out the example repo for more details.

Conclusion

Agentuity makes it incredibly simple to take your existing OpenAI projects, like this agent focused on structured output, and deploy them to the cloud without fuss. Focus on building your agent logic, and let Agentuity handle the deployment. If you want to do some cooler things: You can even build out a Vercel AI SDK agent, or a CrewAI agent and have them all talk to each other! Cool eh?