Installation and setup
Every lesson runs in the browser panel with nothing installed. On your own machine, the SDK can run agents on OpenAI or, through LiteLLM, on a free Groq or Gemini key.
The browser panel
Press Run in the panel beside a lesson. The first run takes a few seconds while Python starts in your browser and the SDK downloads; after that it is instant. Nothing leaves the page, and no key is needed because the course uses a stand-in model you write in lesson 4.
pip install openai-agents 0.22
This course was checked with version 0.22.2.
pip install "openai-agents==0.22.2"Running agents on a free modelOptional
Agents use OpenAI models by default, which read OPENAI_API_KEY from a paid account. For a provider with an OpenAI-compatible API, the SDK docs pass an AsyncOpenAI client with that provider's URL to OpenAIChatCompletionsModel. Traces upload to OpenAI, so without an OpenAI key turn tracing off with set_tracing_disabled, which lesson 23 explains; lesson 24 swaps in a real model.
import os
from agents import Agent, AsyncOpenAI, OpenAIChatCompletionsModel, set_tracing_disabled
set_tracing_disabled(True)
client = AsyncOpenAI(api_key=os.environ["GROQ_API_KEY"], base_url="https://api.groq.com/openai/v1")
agent = Agent(
name="Support",
instructions="Answer questions about orders.",
model=OpenAIChatCompletionsModel(model="openai/gpt-oss-120b", openai_client=client),
)| Provider | Key | Variable | base_url and model |
|---|---|---|---|
| Groq | Free, console.groq.com/keys | GROQ_API_KEY | https://api.groq.com/openai/v1, openai/gpt-oss-120b |
| Gemini | Free, aistudio.google.com/apikey | GEMINI_API_KEY | https://generativelanguage.googleapis.com/v1beta/openai/, gemini-2.5-flash |
| OpenRouter | Free models end in :free, openrouter.ai/keys | OPENROUTER_API_KEY | https://openrouter.ai/api/v1, google/gemma-4-31b-it:free |
| OpenAI | Paid, platform.openai.com/api-keys | OPENAI_API_KEY | No client of your own; the default model |
export GROQ_API_KEY=gsk_...- Run the panel in lesson 2 before installing anything locally.
Little by little, you're building something great.