Menu

openai-python/httpx2.md at main · openai/openai-python
📰

openai-python/httpx2.md at main · openai/openai-python

Hacker News·2 months ago
#UlpAtSZ1
#github#httpx2#openai#python#tls
Reading 0:00
15s threshold

Migrating to HTTPX2

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 use the SDK's default HTTP client

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:

<div dir="auto" data-snippet-clipboard-copy-content="from openai import OpenAI

client = OpenAI(timeout=30.0) response = client.responses.create(model="gpt-5.5", input="Hello")"> from openai import OpenAI

client = OpenAI ( timeout = 30.0 ) response = client . responses .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.