Article may be outdated

This article is 7 days old. Some details may have changed since publication.

Hacker News·5 min read·hard

OpenAI: Migrating to HTTPX2

T
tosh
OpenAI: Migrating to HTTPX2
AI Summary

OpenAI has updated its Python SDK to use HTTPX2 for its HTTP client, replacing the previous httpx dependency. Developers must ensure their environments are configured correctly, particularly regarding TLS trust stores, to avoid connection errors.

Why it matters

This is a breaking change for developers integrating OpenAI's API, requiring updates to infrastructure and certificate management to maintain service stability.

Dive DeeperCreate a free account to unlock

The OpenAI Python SDK now uses HTTPX2 for its synchronous and asynchronous HTTP clients. HTTPX2 is installed automatically with openai ; the previous httpx package is not. This guide explains what changes for applications that interact with the SDK's HTTP layer.

If you construct an OpenAI or AsyncOpenAI client without providing http_client , your existing API calls, parsed response models, streaming APIs, authentication, retries, and numeric timeouts continue to work:

from openai import OpenAI client = OpenAI ( timeout = 30.0 ) response = client . responses . create ( model = "gpt-5.5" , input = "Hello" ) No HTTPX2 extra or separate installation is required:

pip install openai If your application imported httpx only because an earlier SDK installed it transitively, add your own httpx dependency or migrate those imports to httpx2 . Installing the SDK no longer installs httpx for you.

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyai

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in