Getting Started

How to get started with Openai Agents Python

1

Set up Python environment

Ensure Python 3.9 or newer is installed, then create and activate a virtual environment.

2

Install the SDK

Install the openai-agents package using pip.

3

Set API key

Configure the OPENAI_API_KEY environment variable with your OpenAI API key.

4

Create an agent

Define an agent with instructions using the Agent class.

5

Run the agent

Execute the agent with a task using the Runner class and retrieve the output.