OpenAI API · sdk · fg-0134

After upgrading openai-python to 3.x, import httpx fails, respx mocks stop working, or TLS verification breaks

If you see ModuleNotFoundError: No module named 'httpx', the cause and the fix for OpenAI API are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
ModuleNotFoundError: No module named 'httpx'RESPX routes no longer intercept SDK requests and tests hit the networkCERTIFICATE_VERIFY_FAILED in slim containers or behind a TLS inspecting proxyType checker rejects http_client=httpx.Client()
Cause
openai-python 3.0.0 switched to HTTPX2 and stopped installing httpx and certifi. HTTPX2 trusts the operating system certificate store, and only HTTPX2 clients satisfy the type hints.
Fix
Migrate custom clients and mocks to httpx2 equivalents, install system CA certificates or set SSL_CERT_FILE, and add httpx yourself only as a temporary bridge.
Apply
import httpx2 from openai import OpenAI, DefaultHttpx2Client client = OpenAI(http_client=DefaultHttpx2Client(timeout=httpx2.Timeout(30.0))) # TLS: export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
Affected
openai-python 3.0.0 (2026-08-12) and later
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun