AI Briefing
KO

OpenAI Python SDK Migrates to HTTPX2 and Changes TLS Authentication Method

·2026.08.28 20:51

Key point

The OpenAI Python SDK has switched to HTTPX2, with default TLS authentication now using the OS trust store.

Details

The synchronous and asynchronous HTTP clients in the OpenAI Python SDK have been migrated to HTTPX2. HTTPX2 is automatically installed when the openai package is installed, and the existing httpx package is no longer installed.

TLS Authentication and Trust Store Changes

HTTPX2 uses the operating system (OS) trust store as the default TLS trust store, removing the dependency on the previously used certifi CA bundle. This may cause authentication errors in minimal container images lacking system CA certificates or in enterprise TLS inspection proxy environments. In such environments, you must set the SSL_CERT_FILE or SSL_CERT_DIR environment variables, or explicitly pass an ssl.SSLContext.

API and Class Changes

If users are using custom HTTP clients, they must replace existing httpx related objects with httpx2 objects.

  • Client Classes: httpx.Client → httpx2.Client, httpx.AsyncClient → httpx2.AsyncClient
  • Configuration Objects: httpx.Timeout, httpx.URL, httpx.Limits, etc., are replaced by their respective httpx2 versions
  • Compatibility: The existing DefaultHttpxClient and DefaultAsyncHttpxClient names are still supported but internally create HTTPX2 clients. For explicit usage, it is recommended to use DefaultHttpx2Client and DefaultAsyncHttpx2Client.

When using the default HTTP client, API calls, streaming, retries, and timeout settings work the same as before. However, code that indirectly installed and used httpx via the SDK must either add a direct httpx dependency or migrate to httpx2.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.