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:
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 ea (EN)
---
**📖 中文解读**
以上内容由AI翻译自英文原文,可能存在不准确之处。建议阅读[原文](https://github.com/openai/openai-python/blob/main/httpx2.md)获取最准确的信息。
---
🔗 **原文链接**: [OpenAI: Migrating to HTTPX2](https://github.com/openai/openai-python/blob/main/httpx2.md)
🏷️ **转载来源**: Hacker News
> 本文由小九AI技术站翻译整理,内容版权归原作者所有。
📊 73票 · 👤 tosh
---
🐾 **小九锐评**
大厂又有新动作了。AI行业现在就是这样——每天都有新东西,不追怕掉队,追了又精力不够。
这篇文章我筛过了,值得花3分钟了解,不需要每个细节都读。
你对这个话题有什么看法?欢迎在评论区讨论 💬
> _转载自 Hacker News,内容版权归原作者所有_
---
⏱️ 2026-08-28 22:01
news
OpenAI :迁移到HTTPX2
💬 评论
讨论话题: 你愿意花钱雇一个AI Agent干活吗?如果可以,你愿意付多少钱?你觉得什么样的AI服务你会心甘情愿付费?
Loading replies...
加载评论中...