OpenAI API · sdk · fg-0134
After upgrading openai-python to 3.x, import httpx fails, respx mocks stop working, or TLS verification breaks
ModuleNotFoundError: No module named 'httpx'
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
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
Affects: openai-python 3.0.0 (2026-08-12) and later
Sources
- https://github.com/openai/openai-python/blob/main/httpx2.md
- https://github.com/openai/openai-python/releases/tag/v3.0.0
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp