OpenAI has published OpenAI Agents SDK v1.0.0-alpha.3 (2 December 2026), and it changes what the SDK actually is. The root import, from openai_agents import Agent, Runner, now runs the same agent loop as the Codex CLI inside your Python process. The old pure-Python loop has not gone away. It moves to a classic subpackage so you can migrate one workflow at a time.

This guide covers what changed, how to install the alpha safely, how to write a first agent with a Python tool, and how to move existing v0 code without breaking it. I installed the Linux x86-64 wheel and checked the imports and signatures below against it. The model calls themselves are billable, so the examples show the code rather than invented output.

What changed in v1

In v0, the openai-agents package gave you a Python agent loop under the agents import. In v1 the import decides the runtime:

  • openai_agents (root): the embedded Codex engine. The wheel ships the compiled engine, so you don’t need a Rust toolchain or a separate Codex CLI.
  • openai_agents.classic: the v0 Python loop, kept as a supported transition path. The docs say Classic is planned for removal in a future release.
  • openai_agents.realtime: speech-to-speech apps.

According to the release notes, Codex agents can react to tool results, compact long conversations, and resume saved checkpoints on another worker. Alpha.3 also drops the agents alias that alpha.2 had. There is no provider switch at the root any more.

Install the alpha (separately from v0)

This prerelease is GitHub-only and not on PyPI. Both v0 and v1 use the openai-agents distribution name, so installing v1 replaces v0 in the same environment. Use a fresh virtual environment with 64-bit CPython 3.10 to 3.14:

python3 -m venv .venv-agents-v1
. .venv-agents-v1/bin/activate

# Linux x86-64 (glibc 2.28+). Copy the command for your platform
# from the release notes; it pins the wheel URL and SHA-256.
python -m pip install --only-binary=:all: \
  "https://github.com/openai/openai-agents-python/releases/download/v1.0.0-alpha.3/openai_agents-1.0.0a3-cp310-abi3-manylinux_2_28_x86_64.whl#sha256=69aa2d66eb0fa87e480e6e563adb6e4b3676e004c1387833dbb27cf0f1e2d2d8"

Wheels are also published for Linux ARM64, macOS 11+ on Apple Silicon and Windows x64. An unpinned pip install openai-agents can still select v0, so pin the wheel.

Then check that the native engine loads. This needs no API key and makes no model request:

python -I -m openai_agents.codex

On my install this printed 0.172.0. That is the linked Codex runtime version, not the SDK version. openai_agents.__version__ reports 1.0.0a3.

Your first Codex-backed agent

Set OPENAI_API_KEY and OPENAI_MODEL (a model ID your project can use), then:

import asyncio
import os

from openai_agents import Agent, Runner


async def main():
    tutor = Agent(
        model=os.environ["OPENAI_MODEL"],
        instructions="You answer history questions clearly and concisely.",
    )
    result = await Runner.run(tutor, "When did the Roman Empire fall?")
    print(result.output_text)


if __name__ == "__main__":
    asyncio.run(main())

Two differences from v0 trip people up:

  1. Agent(model=...) is required in v1, and name is optional. In v0, name was required and the model could default.
  2. You read result.output_text. The v1 comparison page says result.final_output returns the same value, but output_text is the documented field.

Add a Python function tool

Tools come from openai_agents.codex.function_tool. The decorator builds the tool schema from the function signature and docstring:

import asyncio
import os

from openai_agents import Agent, Runner
from openai_agents.codex import function_tool


@function_tool
def delivery_date(order_id: str) -> str:
    """Look up the expected delivery date for an order."""
    return {"A12": "Friday"}.get(order_id, "Unknown order")


agent = Agent(
    model=os.environ["OPENAI_MODEL"],
    instructions="Use delivery_date to check the order before you answer.",
    tools=[delivery_date],
)

result = asyncio.run(Runner.run(agent, "When will order A12 arrive?"))
print(result.output_text)

In the installed wheel, function_tool also accepts name_override, description_override and needs_approval=False. Set needs_approval=True for anything that writes data or spends money.

Approvals, environments and sessions

The Agent constructor in alpha.3 has these keyword arguments (checked with inspect.signature):

Agent(*, model, name=None, instructions=None, tools=[...],
      reasoning=None, hooks=[...],
      approval_policy=None,   # 'never' | 'on-request' | 'untrusted'
      guardian=False, approval_handler=None, subagents=None)

Runner.run() accepts an environment (a LocalEnvironment or a Sandbox), a workspace path, and conversation state through state=, session_id= or a ConversationStore. The openai_agents.codex module exports InMemorySessionStorage and SQLiteSessionStorage. That’s what makes checkpoint and resume possible.

A minimal approval gate looks like this:

from openai_agents import Agent
from openai_agents.codex import ApprovalRequest


def approve(request: ApprovalRequest) -> bool:
    print("Agent wants to:", request)
    return input("Allow? [y/N] ").strip().lower() == "y"


agent = Agent(
    model="your-model-id",
    approval_policy="on-request",
    approval_handler=approve,
)

The quickstart example grants no shell or file tools. File or command access only happens when you choose an environment, so give the agent a workspace only when it really needs one.

Migrating v0 code

The v0 vs v1 comparison gives a simple import map:

v0 import v1 import
from agents import Agent, Runner from openai_agents.classic import Agent, Runner
from agents import function_tool from openai_agents.classic import function_tool
from agents.voice import VoicePipeline from openai_agents.classic.voice import VoicePipeline
from agents.realtime import RealtimeAgent from openai_agents.realtime import RealtimeAgent

A practical plan:

  1. Install v1 in a separate environment and run your test suite with only the import changed to openai_agents.classic. Behaviour should match v0.
  2. Keep Classic for workflows that depend on Python model adapters (such as LiteLLM), handoffs, guardrails, typed outputs or tracing. The docs say Classic support during v1.x focuses on major bugs and security fixes.
  3. Port one workflow at a time to the Codex root import. Swap final_output for output_text and Classic tools for openai_agents.codex.function_tool.
  4. Don’t mix state. Changing imports doesn’t convert tools or saved conversations. Keep existing sessions on their original loop and give new Codex conversations a separate store.

For streaming, v0’s Runner.run_streamed(...) becomes async with agent.stream(prompt) as events: in v1, and the event types are different. Budget time for that if your UI renders streamed tokens.

Should you use it yet?

It’s an alpha that isn’t on PyPI, so keep it out of production. It’s still worth trying now if you:

  • run long, multi-step agent tasks where context compaction matters,
  • need to pause an agent and resume it on another worker, or
  • already use Codex and want the same loop behind your own Python tools.

If your agents are short tool-calling chats that work fine on v0, wait for a stable release and use the alpha period to test the Classic import path.

Key takeaways

  • v1 alpha.3 makes openai_agents run the Codex agent loop in-process. The v0 loop lives on as openai_agents.classic.
  • Install from the pinned GitHub wheel in a separate environment. PyPI still serves v0.
  • Agent(model=...) is required, and answers come from result.output_text.
  • Tools come from openai_agents.codex.function_tool, with optional needs_approval.
  • Migrate gradually and keep old conversation state on the loop that created it.

Sources: v1.0.0-alpha.3 release notes, v1 quickstart, v1 documentation.