Skip to content

Upgrading openai 2 to 3

Breaking2.54.0 → 3.42.0Breaking2Security3Deprecated2New77Changed30Fixed83Other82

Fetching 53 releases from GitHub…48 / 53
BreakingUpgrade verdict

2 breaking changes and 3 security fixes.

  • The library now uses a new HTTP client by default, and the old one is no longer installed for you. If you set up your own HTTP client or connection settings, you need to switch them to the new equivalents or use a temporary legacy option.
  • The Decisions API types changed. Question instructions can now be plain text or a structured list, so code that assumes plain text may need updating.
  • The library makes the X.509 workload identity login flow more secure.
  • Bundled third-party libraries are updated to versions that fix known security problems.
Top 5 of 7 that need code or config changes

openai publishes an official migration guide for version 3. It covers more than the release notes do.

HTTPX2 migration guide ↗

Adds httpx2 <3,>=2.12.0.

Drops distro, httpx, tqdm.

Installs 13 packages in all (was 15).

Breaking2
HTTPX2 is now the default HTTP client and httpx is no longer installed automatically; custom HTTPX clients, transports, or config objects must migrate.
httpx
Expands Decisions input and question types, making question instructions a string or a list of structured parts.
question.instructionsDecisionInputMessageParam
Security3
Hardens the X.509 workload identity integration in auth.
Updates dependencies that have published security fixes.
Requires patched versions of optional networking dependencies.
Deprecated2
Deprecates the MCP connector_id in the API.
connector_id
Deprecates the Sora video APIs.