Repository navigation
feat!: use httpx2 as the HTTP client library - #1311
Open
mattapperson wants to merge 1 commit into
Open
mattapperson wants to merge 1 commit into
mattapperson wants to merge 1 commit into
Conversation
httpx is no longer actively maintained; httpx2 is its successor, maintained by Pydantic. Closes #947
christineschen
approved these changes
Nov 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #947. Stacked on #1309 (and so on #1308); it ships in the same 1.4.0 release.
Sets
httpClientLibrary: httpx2in.speakeasy/gen.yaml. The generated SDK then depends onhttpx2 >=2.12.0instead ofhttpxandhttpcore, and importshttpx2everywhere it usedhttpx.This PR changes only configuration; the next generation run produces the regenerated SDK.
Breaking for callers who touch the HTTP layer directly:
client=orasync_client=must be anhttpx2.Client/httpx2.AsyncClient.httpx2types, for examplehttpx2.ConnectErrorandhttpx2.TimeoutException.httpx2.Requestandhttpx2.Response.Callers who only use SDK methods need no changes.
Python 3.10
The SDK still declares
requires-python >=3.10. httpx2 2.12.0 supports 3.10; the latest httpx2 requires 3.11, so 3.10 users resolve to an older httpx2.Verification
I regenerated locally on top of #1309. The result passes
uv build, mypy, pyright, pylint and pytest. Against the live API, a sync completion, a streamed completion, an async completion, an error response and a call through a customhttpx2.Clientall worked.Note
uv.lockis not updated here, becausepyproject.tomlonly changes when the SDK is regenerated.