OpenAI Python SDK 3.0 defaults to httpx2, breaking fresh installs

The v3 default drops auto-installed httpx, so tools that imported it break, test mocks leak real calls to the live API, and the TLS trust store shifts.

Nowline AUG 29 4:00 PM banner

Top AI stories from the last hour

Top AI stories from the last hour

Copy markdown

  • httpx2 is the default — and httpx is gone

    openai-python 3.0.0 makes httpx2, the Pydantic team's httpx fork, the default HTTP client and no longer installs httpx at all. Default clients keep working untouched, but any code holding an httpx.Client, transport, or Timeout must move to the httpx2 equivalents.

  • Fresh installs are breaking across the ecosystem

    Packages that imported httpx only transitively through openai now throw "ModuleNotFoundError: No module named 'httpx'" on a clean install. Simon Willison's llm hit exactly this; the fix is to declare httpx as a direct dependency in your own project.

  • Your tests may be hitting the live API silently

    pytest-httpx patches httpx, which openai 3 no longer uses — so mocks stop intercepting and requests quietly go to the real endpoint with dummy keys, failing only on auth. Pin openai<3 or switch to pytest-httpx2 before your CI starts spending tokens.

  • The TLS trust-store trap

    httpx2 changes the default TLS trust store, so calls can fail with certificate errors until you install CA certs in the OS trust store or point SSL_CERT_FILE at a bundle. Easy to miss inside slim containers and CI images.

  • The escape hatches, while they last

    Not ready to migrate? `pip install openai httpx` keeps legacy httpx at runtime (typed via cast(Any, ...)), or pin openai<3. Both are stopgaps — OpenAI says legacy httpx support is a migration aid that "may be discontinued."